aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2012-06-19 02:22:09 +0200
committerPieter Wuille <[email protected]>2012-06-19 02:22:09 +0200
commit4c6b210af0d6047aafe0f600cbcc5122df4132a1 (patch)
tree74b955a1937c22cc9016855a90893cb424c7474c /src/netbase.cpp
parentMerge pull request #1399 from sipa/ipparse (diff)
downloaddiscoin-4c6b210af0d6047aafe0f600cbcc5122df4132a1.tar.xz
discoin-4c6b210af0d6047aafe0f600cbcc5122df4132a1.zip
Fix netbase tests
* Do not rely on "a.b.c" being interpreted as "a.0.b.c" * Parse numeric addresses for address families for which no device is configured
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 953ef13f1..ffd3ea68a 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -65,19 +65,17 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& 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);