[Bug 762512] Re: getaddrinfo() should disregard link-local IPv6 addresses for AI_ADDRCONFIG purposes
Pavel Šimerda
pavlix at pavlix.net
Sun Dec 16 16:13:49 UTC 2012
Upstream bug report:
sourceware.org/bugzilla/show_bug.cgi?id=12377
More information:
https://fedoraproject.org/wiki/Networking/NameResolution/ADDRCONFIG
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/762512
Title:
getaddrinfo() should disregard link-local IPv6 addresses for
AI_ADDRCONFIG purposes
Status in “eglibc” package in Ubuntu:
Confirmed
Bug description:
If the system is configured with link-local (and loopback) IPv6
addresses only, getaddrinfo() will look up AAAA records in DNS and
return any results to the caller, even if the caller is specififying
the AI_ADDRCONFIG hint.
This defeats the purpose of AI_ADDRCONFIG, as an IPv6-capable
operating system (including Ubuntu) will automatically configure link-
local IPv6 addresses on every interface.
RFC 2553 says the following about AI_ADDRCONFIG:
- The AI_ADDRCONFIG flag specifies that a query for AAAA records
should occur only if the node has at least one IPv6 source
address configured and a query for A records should occur only
if the node has at least one IPv4 source address configured.
While it does not mention link-local (or loopback) addresses specifically, it is obvious that its intended use is to allow an application to avoid getting addresses returned that cannot be used for communication. In that regard
link-local addresses are very similar to loopback addresses, in the sense that they're automatically configured on all hosts regardless of any external connectivity, and can not be used when communicating with the outside world. And, as it happens, loopback addresses are already disregarded by getaddrinfo() for AI_ADDRCONFIG (even for IPv4 loopback addresses). This is done in in sysdeps/unix/sysv/linux/check_pf.cl line 179, in make_request().
The current behaviour is causing problems for end users who happen to
be in IPv4-only networks and are using DNS resolvers that do not
correctly handle AAAA lookups (cf. bug #417757 - 317 comments so far).
If getaddrinfo() had not considered the always-present link-local
addresses as an indicator of connectivity to the IPv6 internet, the
problematic AAAA lookups would have been suppressed and the users
would not have experienced any problems.
The one-line patch is trivial. Please apply. For what it's worth, both
Microsoft Windows and Mac OS X appear to disregard link-local IPv6
addresses for AI_ADDRCONFIG purposes, with no apparent ill effects.
Tore
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/762512/+subscriptions
More information about the foundations-bugs
mailing list