THRIFT-5880: ipv6 only linux systems cannot resolve 127.0.0.1
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
index 6c8a1c8..97ca746 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -461,7 +461,9 @@
#ifdef _WIN32
error == WSANO_DATA
#else
- error == EAI_NODATA
+ // to support systems with no ipv4 addresses but using "127.0.0.1" as a hostname
+ // getaddrinfo() fails when AI_ADDRCONFIG is present in this situation...
+ error == EAI_NODATA || error == EAI_ADDRFAMILY
#endif
) {
hints.ai_flags &= ~AI_ADDRCONFIG;