This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[Patch] [BZ 14505] Avoid unwanted A lookups on IPV6 only host
- From: Jeff Law <law at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 21 Aug 2012 16:00:35 -0600
- Subject: [Patch] [BZ 14505] Avoid unwanted A lookups on IPV6 only host
As mentioned in the BZ, when looking up a name via getaddrinfo with
AI_ADDRCONFIG on an IPv6 only host, IN A queries are being sent.
According to RFC 3493, they should not.
The issue is gaih_inet calls gethostbyname4 which issues both A and AAAA
queries.
If we look up in getaddrinfo we see that when the AI_ADDRCONFIG hint is
set, we look at the configured interfaces and set the ai_family flag to
either PF_INET or PF_INET6 if only one type of interface is configured.
If both kinds of interfaces are enabled the hint should continue to be
AF_UNSPEC.
We then pass that information down to gaih_inet where we can trivially
query it before calling gethostbyname4. That's precisely what this
patch implements.
Attachment:
glibc-rh844921.patch
Description: Text document