Skip to content

Commit

Permalink
IPV6_V6ONLY set by default on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
juhovh committed Apr 22, 2014
1 parent aeed166 commit 64d59e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/netutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ netutils_init_socket(unsigned short *port, int use_ipv6, int use_udp)
sin6ptr->sin6_addr = in6addr_any;
sin6ptr->sin6_port = htons(*port);

#ifndef WIN32
/* Make sure we only listen to IPv6 addresses */
setsockopt(server_fd, IPPROTO_IPV6, IPV6_V6ONLY,
(char *) &v6only, sizeof(v6only));
#endif

socklen = sizeof(*sin6ptr);
ret = bind(server_fd, (struct sockaddr *)sin6ptr, socklen);
Expand Down

0 comments on commit 64d59e3

Please sign in to comment.