diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-01 00:29:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-01 00:29:17 +0200 |
commit | 4fd5948e74b776b6d68ba55f558da5f354179e52 (patch) | |
tree | 0bb54d1f5ac17f1de19e71357bd39e595732190c /src/socket-util.c | |
parent | 6398320759ce4ed84922bb28f715d3c6c66166c4 (diff) |
socket: make various socket/pipe options configurable
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; |