This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]