mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-23 14:18:17 -04:00
Restored the code in the IPV6_V6ONLY section that checks the
return value from setsockopt() with one improvement: if the user has used --ipv6 (-6) we don't discard the IPv6 socket. This should help people using older Linux kernels that don't implement IPv6 support quite right.
This commit is contained in:
1 parent
fdf57ede8c
commit
dcd08dc51c
1 file changed
+6
-2
@@ -369,8 +369,12 @@ static int *open_socket_in(int type, int port, const char *bind_address,
|
||||
|
||||
#ifdef IPV6_V6ONLY
|
||||
if (resp->ai_family == AF_INET6) {
|
||||
setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||
(char *)&one, sizeof one);
|
||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||
(char *)&one, sizeof one) < 0
|
||||
&& default_af_hint != AF_INET6) {
|
||||
close(s);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user