summaryrefslogtreecommitdiff
path: root/src/ip.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-02-15 19:58:47 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-02-15 19:58:47 +0100
commit7778010d76e6da534307ca3f0a3506d3d7f0ec5d (patch)
tree7b450001b55efd7b9ab35d6d5e6052ba366b5427 /src/ip.cpp
parent817c89a78ea7b773046b010ca129fd1206e1c8f0 (diff)
care taken of the fact that AI_NUMERICSERV is not defined on OSX 10.5
Diffstat (limited to 'src/ip.cpp')
-rw-r--r--src/ip.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ip.cpp b/src/ip.cpp
index 595689f..0fb2adf 100644
--- a/src/ip.cpp
+++ b/src/ip.cpp
@@ -239,7 +239,11 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
// Restrict hostname/service to literals to avoid any DNS lookups or
// service-name irregularity due to indeterminate socktype.
- req.ai_flags = AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV;
+#if defined ZMQ_HAVE_OSX
+ req.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
+#else
+ req.ai_flags = AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV;
+#endif
// Resolve the literal address. Some of the error info is lost in case
// of error, however, there's no way to report EAI errors via errno.
@@ -289,6 +293,11 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
// Avoid named services due to unclear socktype, and don't pick IPv6
// addresses if we don't have a local IPv6 address configured.
req.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
+#if defined ZMQ_HAVE_OSX
+ req.ai_flags = AI_ADDRCONFIG;
+#else
+ req.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
+#endif
// Resolve host name. Some of the error info is lost in case of error,
// however, there's no way to report EAI errors via errno.