From 2fdcfb9429be64842d2a730801d2b5700d40d7b9 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 6 Aug 2020 21:59:17 -0700 Subject: [PATCH] Accept IPv6 addresses for network testing to support NAT64 --- src/ConnectionTester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ConnectionTester.c b/src/ConnectionTester.c index 78d554c..fef74ee 100644 --- a/src/ConnectionTester.c +++ b/src/ConnectionTester.c @@ -99,7 +99,7 @@ unsigned int LiTestClientConnectivity(const char* testServer, unsigned short ref } memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; + hints.ai_family = AF_UNSPEC; hints.ai_flags = AI_ADDRCONFIG; err = getaddrinfo(testServer, NULL, &hints, &serverAddrs); @@ -127,7 +127,7 @@ unsigned int LiTestClientConnectivity(const char* testServer, unsigned short ref for (i = 0; i < PORT_FLAGS_MAX_COUNT; i++) { if (testPortFlags & (1 << i)) { - sockets[i] = socket(hints.ai_family, + sockets[i] = socket(current->ai_family, LiGetProtocolFromPortFlagIndex(i) == IPPROTO_UDP ? SOCK_DGRAM : SOCK_STREAM, LiGetProtocolFromPortFlagIndex(i)); if (sockets[i] == INVALID_SOCKET) {