1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 17:47:37 +00:00

(trunk libT) #2669 "Apply IPV6_V6ONLY to the IPv6 DHT socket" -- committed jch's patch for 1.80

This commit is contained in:
Charles Kerr 2009-12-15 16:48:26 +00:00
parent c17932f533
commit de9498f1ab

View file

@ -319,10 +319,18 @@ tr_dhtInit(tr_session *ss, const tr_address * tr_addr)
goto fail;
if(tr_globalIPv6()) {
int one = 1;
dht6_socket = socket(PF_INET6, SOCK_DGRAM, 0);
if(dht6_socket < 0)
goto fail;
#ifdef IPV6_V6ONLY
/* Since we always open an IPv4 socket on the same port, this
shouldn't matter. But I'm superstitious. */
setsockopt(dht6_socket, IPPROTO_IPV6, IPV6_V6ONLY,
&one, sizeof(one));
#endif
rebind_ipv6(1);
}