This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [bug] nss resolver code doesn't stop at files lookup
On Sat, Nov 11, 2000 at 11:45:00AM +0000, Philip Blundell wrote:
> >But if hint is NULL, or hint.af_family == PF_UNSPEC, should getaddrinfo()
> >fail because it had trouble finding an ipv6 addr? That makes it mandatory
> >to have ipv6 support, just to use that function.
>
> No. It should go looking for IPv6 addresses, but it isn't entitled to fail
> if they are unavailable.
>
> Do you have a test case that shows the bad behaviour?
Note, this doesn't neccesarily have to do with IPv6, per se. It has to do
with getaddrinfo failing completely, if any of it's DNS attempts fail for
something other than "notfound" (like unreachable, connection refused,
etc...). To try this test case, either put nothing in /etc/resolv.conf, or
put a nameserver IP that is not actually running bind (connection
refused).
Ben
--
-----------=======-=-======-=========-----------=====------------=-=------
/ Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
`---=========------=======-------------=-=-----=-===-======-------=--=---'
#include <netdb.h>
int main(void)
{
struct addrinfo *ap, hint;
int r;
memset (&hint, 0, sizeof(struct addrinfo));
hint.ai_family = PF_UNSPEC;
/* The getaddrinfo test */
r = getaddrinfo("localhost", NULL, &hint, &ap);
if (r != 0)
printf("getaddrinfo: cant find `localhost'\n");
else
printf("getaddrinfo: `localhost' found\n");
exit(0);
}