diff options
author | Mark Michelson <mmichelson@digium.com> | 2010-07-12 14:55:23 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2010-07-12 14:55:23 +0000 |
commit | b1b29e521450ba707f49a1ae7575f256f23ddcf0 (patch) | |
tree | a3c84c3af150fc4ed46572ee147ee8db042e21e5 /main/netsock2.c | |
parent | f1df8ea2bf5e09585202db293740c9b7bc264c0d (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: https://origsvn.digium.com/svn/asterisk/trunk@275587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/netsock2.c')
-rw-r--r-- | main/netsock2.c | 4 |
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)); |