diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 11f63310b..2b12ef8e8 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -160,6 +160,9 @@ int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct so #if defined(IPV6_TRANSPARENT) || (setsockopt(fd, SOL_IPV6, IPV6_TRANSPARENT, &one, sizeof(one)) == 0) #endif +#if defined(IP_FREEBIND) + || (setsockopt(fd, SOL_IP, IP_FREEBIND, &one, sizeof(one)) == 0) +#endif #if defined(IPV6_BINDANY) || (setsockopt(fd, IPPROTO_IPV6, IPV6_BINDANY, &one, sizeof(one)) == 0) #endif @@ -787,6 +790,9 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen) #if defined(IPV6_TRANSPARENT) && (setsockopt(fd, SOL_IPV6, IPV6_TRANSPARENT, &one, sizeof(one)) == -1) #endif +#if defined(IP_FREEBIND) + && (setsockopt(fd, SOL_IP, IP_FREEBIND, &one, sizeof(one)) == -1) +#endif #if defined(IPV6_BINDANY) && (setsockopt(fd, IPPROTO_IPV6, IPV6_BINDANY, &one, sizeof(one)) == -1) #endif