Skip to content

Commit

Permalink
Merge pull request #177 from flaviojs/clarify-IPV6_V6ONLY
Browse files Browse the repository at this point in the history
Clarify why IPV6_V6ONLY is being unset.
  • Loading branch information
grossmj authored Mar 15, 2024
2 parents ddff77e + 59e47e9 commit f1bd8b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,10 @@ static int ip_socket_bind(struct addrinfo *addr)
return(-1);

#ifdef IPV6_V6ONLY
setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY,&off,sizeof(off));
if (addr->ai_family == AF_INET6) {
// if supported, allow packets to/from IPv4-mapped IPv6 addresses
(void)setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY,&off,sizeof(off));
}
#endif

if ( (bind(fd,addr->ai_addr,addr->ai_addrlen) < 0) ||
Expand Down

0 comments on commit f1bd8b4

Please sign in to comment.