Bug 4599 - loopback addresses are not ignored when the AI_ADDRCONFIG flag is set
Summary: loopback addresses are not ignored when the AI_ADDRCONFIG flag is set
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-07 16:43 UTC by Davi Arnaut
Modified: 2014-07-04 16:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davi Arnaut 2007-06-07 16:43:37 UTC
-- RFC 3493 states:

If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
returned only if an IPv4 address is configured on the local system,
and IPv6 addresses shall be returned only if an IPv6 address is
configured on the local system.  The loopback address is not
considered for this case as valid as a configured address.

For example, when using the DNS, a query for AAAA records should
occur only if the node has at least one IPv6 address configured
(other than IPv6 loopback) and a query for A records should occur
only if the node has at least one IPv4 address configured (other
than the IPv4 loopback).

-- end

The problem is that the getaddrinfo and __check_pf (seen_ipv4 or seen_ipv6)
functions don't take into account the fact that the loopback addresses must
be ignored when AI_ADDRCONFIG is set.

For example, a call to getaddrinfo, link this one:

getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0|AI_ADDRCONFIG})

must fail on machines with no public ipv6 addresses.
Comment 1 Ulrich Drepper 2007-06-16 16:55:44 UTC
I checked in changes to the CVS mainline.