mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
MINOR: tcp: don't try to set/clear v6only on inherited sockets
If a socket was already bound (inherited from a parent or retrieved from a previous process), there's no point trying to change its IPV6_V6ONLY state since it will fail. This is visible in strace as an EINVAL during a reload when passing FDs.
This commit is contained in:
parent
adabbfe5a4
commit
bbb284d675
@ -974,9 +974,9 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
||||
}
|
||||
#endif
|
||||
#if defined(IPV6_V6ONLY)
|
||||
if (listener->options & LI_O_V6ONLY)
|
||||
if (!ext && listener->options & LI_O_V6ONLY)
|
||||
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
|
||||
else if (listener->options & LI_O_V4V6)
|
||||
else if (!ext && listener->options & LI_O_V4V6)
|
||||
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof(zero));
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user