diff --git a/src/netbase.cpp b/src/netbase.cpp index 953ef13f19..ffd3ea68a5 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -65,19 +65,17 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, unsign #ifdef WIN32 # ifdef USE_IPV6 aiHint.ai_family = AF_UNSPEC; - aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; # else aiHint.ai_family = AF_INET; - aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; # endif + aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; #else # ifdef USE_IPV6 aiHint.ai_family = AF_UNSPEC; - aiHint.ai_flags = AI_ADDRCONFIG | (fAllowLookup ? 0 : AI_NUMERICHOST); # else aiHint.ai_family = AF_INET; - aiHint.ai_flags = AI_ADDRCONFIG | (fAllowLookup ? 0 : AI_NUMERICHOST); # endif + aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST; #endif struct addrinfo *aiRes = NULL; int nErr = getaddrinfo(pszName, NULL, &aiHint, &aiRes); diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp index 77a360aca3..f0828f39fc 100644 --- a/src/test/netbase_tests.cpp +++ b/src/test/netbase_tests.cpp @@ -86,7 +86,6 @@ BOOST_AUTO_TEST_CASE(netbase_lookupnumeric) BOOST_CHECK(TestParse("[::]:8333", "[::]:8333")); BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535")); BOOST_CHECK(TestParse(":::", "")); - BOOST_CHECK(TestParse("128.5.1", "128.5.0.1:65535")); } BOOST_AUTO_TEST_SUITE_END()