aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-12 14:55:23 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-12 14:55:23 +0000
commit360d75f8ea8aace7333aeb32023845b5c30439a2 (patch)
treea3c84c3af150fc4ed46572ee147ee8db042e21e5 /main
parent656fa9ad7507010f40e0e3db0042e43b0035fbbd (diff)
Allow netsock2.c to compile on systems that do not define AI_NUMERICSERV.
(closes issue #17617) Reported by: pprindeville Patches: asterisk-trunk-bugid17617.patch uploaded by pprindeville (license 347) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275587 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/netsock2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/netsock2.c b/main/netsock2.c
index 6066604b9..8e4f55ebf 100644
--- a/main/netsock2.c
+++ b/main/netsock2.c
@@ -195,7 +195,11 @@ int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
/* Hint to get only one entry from getaddrinfo */
hints.ai_socktype = SOCK_DGRAM;
+#ifdef AI_NUMERICSERV
hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
+#else
+ hints.ai_flags = AI_NUMERICHOST;
+#endif
if ((e = getaddrinfo(host, port, &hints, &res))) {
ast_log(LOG_ERROR, "getaddrinfo(\"%s\", \"%s\", ...): %s\n",
host, S_OR(port, "(null)"), gai_strerror(e));