diff options
| author | Wayne Davison <wayned@samba.org> | 2004-06-20 19:51:19 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2004-06-20 19:51:19 +0000 |
| commit | dcd08dc51cb77e9ab796d1bdb5739436c90a6ad4 (patch) | |
| tree | 0e73eda7cbb44703f3b59a9c76a5b931a4186228 /socket.c | |
| parent | fdf57ede8c1cd60ee07f6f8eab5fbfac1224a431 (diff) | |
| download | android_external_rsync-dcd08dc51cb77e9ab796d1bdb5739436c90a6ad4.tar.gz android_external_rsync-dcd08dc51cb77e9ab796d1bdb5739436c90a6ad4.tar.bz2 android_external_rsync-dcd08dc51cb77e9ab796d1bdb5739436c90a6ad4.zip | |
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.
Diffstat (limited to 'socket.c')
| -rw-r--r-- | socket.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |
