Bug 435563

Summary: Should getaddrinfo()'s AI_ADDRCONFIG flag ignore loopback interfaces?
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: drepper
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-13 02:53:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sam Varshavchik 2008-03-01 18:40:22 UTC
Description of problem:

On a host with IPV4-only interfaces, getaddrinfo() still returns AF_INET6
addresses even if the AI_ADDRCONFIG flag is specified.

Version-Release number of selected component (if applicable):

2.7

How reproducible:

always

Steps to Reproduce:

1. Invoke getaddrinfo() to look up a hostname with both AF_INET and AF_INET6
addresses, on a host that has only IPv4 connectivity.

Actual results:

getaddrinfo() will return both IPv6 and IPv4 addresses.

Expected results:

Only IPv4 addresses should be returned.

Additional info:

This is because in Fedora, the loopback interface is set up with the IPv6
loopback address ::1, in addition to 127.0.0.1. As such, getaddrinfo() thinks
that the host has IPv6 connectivity. Essentially, the AI_ADDRCONFIG flag is
always ignored.

Given the intent of the AI_ADDRCONFIG flag, getaddrinfo() should skip loopback
interfaces, when evaluating the AI_ADDRCONFIG flag.

Comment 1 Ulrich Drepper 2008-03-13 02:53:19 UTC
Loopback addresses are ignored for some time now.