aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2016-07-05 15:16:36 +0100
committerRon Yorston <rmy@pobox.com>2016-07-05 15:16:36 +0100
commita0c61c9492723dd31681f878f9c68c92817a476d (patch)
tree339d01ae6262aaee7c18c8ad1bf0b4b84daca13c
parent433c19047d1ea4e2e1c35c41368d5a43fe890a25 (diff)
downloadbusybox-w32-a0c61c9492723dd31681f878f9c68c92817a476d.tar.gz
busybox-w32-a0c61c9492723dd31681f878f9c68c92817a476d.tar.bz2
busybox-w32-a0c61c9492723dd31681f878f9c68c92817a476d.zip
libbb: set new listening sockets to dual-stack mode
IPv6 sockets are created in IPv6-only mode on Microsoft Windows. The IPv6 socket option IPV6_V6ONLY needs to be turned off to permit dual-stack operation. Without this change netcat only listens on IPv6 addresses when run with no explicit IP address argument.
-rw-r--r--libbb/xconnect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 0a4d8f128..c318af419 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -353,6 +353,10 @@ int FAST_FUNC xsocket_type(len_and_sockaddr **lsap, int family, int sock_type)
353#if ENABLE_FEATURE_IPV6 353#if ENABLE_FEATURE_IPV6
354 fd = socket(AF_INET6, sock_type, 0); 354 fd = socket(AF_INET6, sock_type, 0);
355 if (fd >= 0) { 355 if (fd >= 0) {
356#if ENABLE_PLATFORM_MINGW32
357 DWORD buffer = 0;
358 setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &buffer, sizeof(DWORD));
359#endif
356 family = AF_INET6; 360 family = AF_INET6;
357 goto done; 361 goto done;
358 } 362 }