This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12377] New: getaddrinfo() should disregard link-local IPv6 addresses for AI_ADDRCONFIG purposes
- From: "tore at fud dot no" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Sat, 8 Jan 2011 20:57:37 +0000
- Subject: [Bug libc/12377] New: getaddrinfo() should disregard link-local IPv6 addresses for AI_ADDRCONFIG purposes
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12377
Summary: getaddrinfo() should disregard link-local IPv6
addresses for AI_ADDRCONFIG purposes
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: tore@fud.no
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
(which includes all modern GNU/Linux distributions) 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().
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.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.