tools: net: support IPv4 and IPv6 addresses
Switch from IPv4-only to an unspecified address family, which will allow
either IPv4 or IPv6 addresses to be used.
Signed-off-by: Benjamin Fair <benjaminfair@google.com>
Change-Id: I6f4d3e71e2a310fc158ec90793f5c7479e060f02
diff --git a/tools/net.cpp b/tools/net.cpp
index 9027862..c971cb8 100644
--- a/tools/net.cpp
+++ b/tools/net.cpp
@@ -81,7 +81,7 @@
struct addrinfo hints;
std::memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
- hints.ai_family = AF_INET;
+ hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
struct addrinfo *addrs, *addr;