mirror of
https://github.com/transmission/transmission
synced 2025-02-02 20:43:51 +00:00
(trunk libT) don't attempt to set V6ONLY on ipv4 sockets
This commit is contained in:
parent
769af9c213
commit
61e505b8d1
1 changed files with 3 additions and 2 deletions
|
@ -543,8 +543,9 @@ tr_netBindTCP( const tr_address * addr, tr_port port, tr_bool suppressMsgs )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IPV6_V6ONLY
|
#ifdef IPV6_V6ONLY
|
||||||
if( retval = setsockopt( s, IPPROTO_IPV6, IPV6_V6ONLY, &optval,
|
if( addr->type == TR_AF_INET6 &&
|
||||||
sizeof( optval ) ) == -1 ) {
|
( retval = setsockopt( s, IPPROTO_IPV6, IPV6_V6ONLY, &optval,
|
||||||
|
sizeof( optval ) ) ) == -1 ) {
|
||||||
/* the kernel may not support this. if not, ignore it */
|
/* the kernel may not support this. if not, ignore it */
|
||||||
if( errno != ENOPROTOOPT )
|
if( errno != ENOPROTOOPT )
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
Loading…
Reference in a new issue