Skip to content

Commit e42017c

Browse files
committed
nstun: set IPV6_V6ONLY on IPv6 so it doesn't collide with IPv4
1 parent 86530d8 commit e42017c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

nstun/nstun.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ bool nstun_init_parent(int sock, nsj_t* nsj) {
444444
if (nr.proto == NSTUN_PROTO_TCP)
445445
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
446446
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
447+
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
447448

448449
struct sockaddr_in6 addr = INIT_SOCKADDR_IN6(AF_INET6);
449450
addr.sin6_port = htons(port);

0 commit comments

Comments
 (0)