assert(u);
assert(u->meta.load_state == UNIT_STUB);
- s->timer_watch.type = WATCH_INVALID;
s->backlog = SOMAXCONN;
s->timeout_usec = DEFAULT_TIMEOUT_USEC;
s->directory_mode = 0755;
"%sSocketMode: %04o\n"
"%sDirectoryMode: %04o\n",
prefix, socket_state_to_string(s->state),
- prefix, yes_no(s->bind_ipv6_only),
+ prefix, socket_address_bind_ipv6_only_to_string(s->bind_ipv6_only),
prefix, s->backlog,
prefix, kill_mode_to_string(s->kill_mode),
prefix, s->socket_mode,
if ((r = socket_address_print(&p->address, &t)) < 0)
return r;
- unit_serialize_item_format(u, f, "socket", "%i %s", copy, t);
+ unit_serialize_item_format(u, f, "socket", "%i %i %s", copy, p->address.type, t);
free(t);
} else {
assert(p->type == SOCKET_FIFO);
}
} else if (streq(key, "socket")) {
- int fd, skip = 0;
+ int fd, type, skip = 0;
SocketPort *p;
- if (sscanf(value, "%i %n", &fd, &skip) < 1 || fd < 0 || !fdset_contains(fds, fd))
+ if (sscanf(value, "%i %i %n", &fd, &type, &skip) < 2 || fd < 0 || type < 0 || !fdset_contains(fds, fd))
log_debug("Failed to parse socket value %s", value);
else {
LIST_FOREACH(port, p, s->ports)
- if (socket_address_is(&p->address, value+skip))
+ if (socket_address_is(&p->address, value+skip, type))
break;
if (p) {
assert(s);
assert(fd >= 0);
+ if (s->state != SOCKET_LISTENING)
+ return;
+
log_debug("Incoming traffic on %s", u->meta.id);
if (events != EPOLLIN) {