This commit is contained in:
irungentoo 2014-06-27 15:47:12 -04:00
commit f433065875
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -181,13 +181,13 @@ int set_socket_dualstack(sock_t sock)
{ {
int ipv6only = 0; int ipv6only = 0;
socklen_t optsize = sizeof(ipv6only); socklen_t optsize = sizeof(ipv6only);
int res = getsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6only, &optsize); int res = getsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&ipv6only, &optsize);
if ((res == 0) && (ipv6only == 0)) if ((res == 0) && (ipv6only == 0))
return 1; return 1;
ipv6only = 0; ipv6only = 0;
return (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6only, sizeof(ipv6only)) == 0); return (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&ipv6only, sizeof(ipv6only)) == 0);
} }