This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] [BZ 14505] Avoid unwanted A lookups on IPV6 only host
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 21 Aug 2012 15:06:38 -0700 (PDT)
- Subject: Re: [Patch] [BZ 14505] Avoid unwanted A lookups on IPV6 only host
- References: <50340503.7020502@redhat.com>
Seems simpler to test "&& req->ai_family == PF_UNSPEC".
Also, you shouldn't call __nss_lookup_function at all when
you're not going to use its result. So make it:
nss_gethostbyname4_r fct4 = NULL;
/* comment */
if (req->ai_family == PF_UNSPEC)
fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
if (fct4 != NULL)
Thanks,
Roland