X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsocket.c;h=8edf0ce5912f1a44857ae8e7ad1ccc2e78fb1425;hb=1f812feafb4b98d5cfa2934886bbdd43325780bb;hp=f20b78d1a611adca0aade1c1531b6b50bc2ba917;hpb=4fd5948e74b776b6d68ba55f558da5f354179e52;p=elogind.git diff --git a/src/socket.c b/src/socket.c index f20b78d1a..8edf0ce59 100644 --- a/src/socket.c +++ b/src/socket.c @@ -50,7 +50,7 @@ static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = { [SOCKET_STOP_POST] = UNIT_DEACTIVATING, [SOCKET_FINAL_SIGTERM] = UNIT_DEACTIVATING, [SOCKET_FINAL_SIGKILL] = UNIT_DEACTIVATING, - [SOCKET_MAINTENANCE] = UNIT_INACTIVE, + [SOCKET_MAINTENANCE] = UNIT_MAINTENANCE }; static void socket_init(Unit *u) { @@ -66,15 +66,10 @@ static void socket_init(Unit *u) { s->max_connections = 64; - s->keep_alive = false; s->priority = -1; - s->receive_buffer = 0; - s->send_buffer = 0; s->ip_tos = -1; s->ip_ttl = -1; - s->pipe_size = 0; s->mark = -1; - s->free_bind = false; exec_context_init(&s->exec_context); @@ -577,9 +572,15 @@ static void socket_apply_socket_options(Socket *s, int fd) { if (setsockopt(fd, IPPROTO_IP, IP_TOS, &s->ip_tos, sizeof(s->ip_tos)) < 0) log_warning("IP_TOS failed: %m"); - if (s->ip_ttl >= 0) - if (setsockopt(fd, IPPROTO_IP, IP_TTL, &s->ip_ttl, sizeof(s->ip_ttl)) < 0) - log_warning("IP_TTL failed: %m"); + if (s->ip_ttl >= 0) { + int r, x; + + r = setsockopt(fd, IPPROTO_IP, IP_TTL, &s->ip_ttl, sizeof(s->ip_ttl)); + x = setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &s->ip_ttl, sizeof(s->ip_ttl)); + + if (r < 0 && x < 0) + log_warning("IP_TTL/IPV6_UNICAST_HOPS failed: %m"); + } } static void socket_apply_pipe_options(Socket *s, int fd) {