From b8433e9261c516d7b8743b33681050b6666192e5 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 12 Nov 2013 00:28:50 +0100 Subject: Check for working getaddrinfo() function At least AIX 4.3.3 and 5.1 have a broken implementation of getaddrinfo() which doesn't handle "0" as numeric service correctly. This patch adds a configure check for this case and changes all calling functions to only use getaddrinfo() if it "works". See --- src/ipaddr/ng_ipaddr.c | 2 +- src/ngircd/resolve.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ipaddr/ng_ipaddr.c b/src/ipaddr/ng_ipaddr.c index 9cf35ec9..37f75b6d 100644 --- a/src/ipaddr/ng_ipaddr.c +++ b/src/ipaddr/ng_ipaddr.c @@ -23,7 +23,7 @@ GLOBAL bool ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) { -#ifdef HAVE_GETADDRINFO +#ifdef HAVE_WORKING_GETADDRINFO int ret; char portstr[64]; struct addrinfo *res0; diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index 6078da8b..01f730cc 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -242,7 +242,7 @@ ForwardLookup(const char *hostname, array *IpAddr, int af) { ng_ipaddr_t addr; -#ifdef HAVE_GETADDRINFO +#ifdef HAVE_WORKING_GETADDRINFO int res; struct addrinfo *a, *ai_results; static struct addrinfo hints; -- cgit 1.4.1