From: Mark Andrews Date: Thu, 6 Jun 2002 00:27:37 +0000 (+0000) Subject: 1219. [bug] Set AI_ADDRCONFIG when looking up addresses X-Git-Tag: v9.0.1^2~8325 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c3184b4e2a1f238f4615d36fee79df82b1711344;p=thirdparty%2Fbind9.git 1219. [bug] Set AI_ADDRCONFIG when looking up addresses via getaddrinfo() (affects dig, host, nslookup, rndc and nsupdate). --- diff --git a/CHANGES b/CHANGES index 749840b8b54..6eb240e8e66 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1219. [bug] Set AI_ADDRCONFIG when looking up addresses + via getaddrinfo() (affects dig, host, nslookup, rndc + and nsupdate). + 1218. [bug] The CINCLUDES macro in lib/dns/sec/dst/Makefile could be left with a trailing "\" after configure has been run. diff --git a/lib/bind9/getaddresses.c b/lib/bind9/getaddresses.c index 32df5566b3d..10c1f7f08bd 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.9 2001/11/16 06:48:22 bwelling Exp $ */ +/* $Id: getaddresses.c,v 1.10 2002/06/06 00:27:37 marka Exp $ */ #include #include @@ -87,8 +87,10 @@ bind9_getaddresses(const char *hostname, in_port_t port, hints.ai_family = PF_INET; else if (!have_ipv4) hints.ai_family = PF_INET6; - else + else { hints.ai_family = PF_UNSPEC; + hints.ai_flags = AI_ADDRCONFIG; + } hints.ai_socktype = SOCK_STREAM; result = getaddrinfo(hostname, NULL, &hints, &ai); switch (result) {