From: Mark Andrews Date: Fri, 20 Dec 2002 04:10:03 +0000 (+0000) Subject: AI_ADDRCONFIG is not allowed by the old getaddinfo() spec. Try with X-Git-Tag: v9.2.3rc1~104^2~193 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=d457997b3b3ab1b79059707db89ae1dfb1d3c195;p=thirdparty%2Fbind9.git AI_ADDRCONFIG is not allowed by the old getaddinfo() spec. Try with then without AI_ADDRCONFIG if the former faile with BADFLAGS. --- diff --git a/lib/bind9/getaddresses.c b/lib/bind9/getaddresses.c index 61d838f3500..bc27b17fc5c 100644 --- a/lib/bind9/getaddresses.c +++ b/lib/bind9/getaddresses.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: getaddresses.c,v 1.12 2002/07/29 00:35:17 marka Exp $ */ +/* $Id: getaddresses.c,v 1.13 2002/12/20 04:10:03 marka Exp $ */ #include #include @@ -94,6 +94,9 @@ bind9_getaddresses(const char *hostname, in_port_t port, #endif } hints.ai_socktype = SOCK_STREAM; +#ifdef AI_ADDRCONFIG + again: +#endif result = getaddrinfo(hostname, NULL, &hints, &ai); switch (result) { case 0: @@ -103,6 +106,13 @@ bind9_getaddresses(const char *hostname, in_port_t port, case EAI_NODATA: #endif return (ISC_R_NOTFOUND); +#ifdef AI_ADDRCONFIG + case EAI_BADFLAGS: + if ((hints.ai_flags & AI_ADDRCONFIG) != 0) { + hints.ai_flags &= ~AI_ADDRCONFIG; + goto again; + } +#endif default: return (ISC_R_FAILURE); }