mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +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:
parent
c17932f533
commit
de9498f1ab
1 changed files with 8 additions and 0 deletions
|
@ -319,10 +319,18 @@ tr_dhtInit(tr_session *ss, const tr_address * tr_addr)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if(tr_globalIPv6()) {
|
if(tr_globalIPv6()) {
|
||||||
|
int one = 1;
|
||||||
dht6_socket = socket(PF_INET6, SOCK_DGRAM, 0);
|
dht6_socket = socket(PF_INET6, SOCK_DGRAM, 0);
|
||||||
if(dht6_socket < 0)
|
if(dht6_socket < 0)
|
||||||
goto fail;
|
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);
|
rebind_ipv6(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue