diff options
Diffstat (limited to 'src/socket-util.c')
-rw-r--r-- | src/socket-util.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/socket-util.c b/src/socket-util.c index 4a1b3d8b51..344d6b98a4 100644 --- a/src/socket-util.c +++ b/src/socket-util.c @@ -305,6 +305,7 @@ int socket_address_listen( int backlog, SocketAddressBindIPv6Only only, const char *bind_to_device, + bool free_bind, mode_t directory_mode, mode_t socket_mode, int *ret) { @@ -330,6 +331,12 @@ int socket_address_listen( if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, bind_to_device, strlen(bind_to_device)+1) < 0) goto fail; + if (free_bind) { + one = 1; + if (setsockopt(fd, IPPROTO_IP, IP_FREEBIND, &one, sizeof(one)) < 0) + log_warning("IP_FREEBIND failed: %m"); + } + one = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) goto fail; |