chiark / gitweb /
main: fix reexec
[elogind.git] / src / socket-util.c
index 4c28946b71aba85f90728c34e4ff166b7ebea420..e2e89886d49e43c26e2ba29e804e18a6cf8ac6da 100644 (file)
@@ -268,7 +268,7 @@ int socket_address_verify(const SocketAddress *a) {
                         }
                 }
 
-                if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM && a->type == SOCK_SEQPACKET)
+                if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM && a->type != SOCK_SEQPACKET)
                         return -EINVAL;
 
                 return 0;
@@ -389,6 +389,7 @@ int socket_address_listen(
                 SocketAddressBindIPv6Only only,
                 const char *bind_to_device,
                 bool free_bind,
+                bool transparent,
                 mode_t directory_mode,
                 mode_t socket_mode,
                 const char *label,
@@ -433,6 +434,12 @@ int socket_address_listen(
                         if (setsockopt(fd, IPPROTO_IP, IP_FREEBIND, &one, sizeof(one)) < 0)
                                 log_warning("IP_FREEBIND failed: %m");
                 }
+
+                if (transparent) {
+                        one = 1;
+                        if (setsockopt(fd, IPPROTO_IP, IP_TRANSPARENT, &one, sizeof(one)) < 0)
+                                log_warning("IP_TRANSPARENT failed: %m");
+                }
         }
 
         one = 1;