Launchpad has imported 2 comments from the remote bug at
https://sourceware.org/bugzilla/show_bug.cgi?id=14969.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2012-12-17T17:08:20+00:00 Psimerda wrote:

getaddrinfo() with AI_ADDRCONFIG replaces all ::1 with 127.0.0.1 on
hosts without non-loopback IPv6 addresses. See the following test
result:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
qlen 1000
    link/ether f0:de:f1:b8:6a:ee brd ff:ff:ff:ff:ff:ff
    inet 84.246.161.88/28 brd 84.246.161.95 scope global eth0

getaddrinfo host="None" hints.ai_flags=AI_ADDRCONFIG:
  ::1
  127.0.0.1
getaddrinfo host="localhost" hints.ai_flags=AI_ADDRCONFIG:
  127.0.0.1
  127.0.0.1
getaddrinfo host="127.0.0.1" hints.ai_flags=AI_ADDRCONFIG:
  127.0.0.1
getaddrinfo host="localhost4" hints.ai_flags=AI_ADDRCONFIG:
  127.0.0.1
getaddrinfo host="::1" hints.ai_flags=AI_ADDRCONFIG:
  ::1
getaddrinfo host="localhost6" hints.ai_flags=AI_ADDRCONFIG:
  127.0.0.1
getaddrinfo host="195.47.235.3" hints.ai_flags=AI_ADDRCONFIG:
  195.47.235.3
getaddrinfo host="2a02:38::1001" hints.ai_flags=AI_ADDRCONFIG:
  2a02:38::1001
getaddrinfo host="info.nix.cz" hints.ai_flags=AI_ADDRCONFIG:
  195.47.235.3
getaddrinfo host="www.google.com" hints.ai_flags=AI_ADDRCONFIG:
  173.194.39.81
  173.194.39.82
  173.194.39.80
  173.194.39.84
  173.194.39.83

Especially notable are:

getaddrinfo(localhost) -> 127.0.0.1, 127.0.0.1 (duplicate)
getaddrinfo(localhost6) -> 127.0.0.1 (wrong)

Contents of /etc/hosts:

127.0.0.1       localhost localhost4
::1             localhost localhost6

Looks like some sort of black magic someone was trying to solve
something.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/582585/comments/2

------------------------------------------------------------------------
On 2012-12-17T17:09:23+00:00 Psimerda wrote:

Testing script:

#!/usr/bin/python3
import sys
from socket import *
hosts = [
    None,
    "localhost",
    "127.0.0.1",
    "localhost4",
    "::1",
    "localhost6",
    "195.47.235.3",
    "2a02:38::1001",
    "info.nix.cz",
    "www.google.com",
]
for host in hosts:
    print("getaddrinfo host=\"{}\" hints.ai_flags=AI_ADDRCONFIG:".format(host))
    try:
        for item in getaddrinfo(host, "http", AF_UNSPEC, SOCK_STREAM, SOL_TCP, 
AI_ADDRCONFIG):
            print("  {}".format(item[4][0]))
    except gaierror as error:
        print("  !! {} !!".format(error))

Reply at:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/582585/comments/3

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/582585

Title:
  getaddrinfo() returns duplicate addresses under AI_ADDRCONFIG

To manage notifications about this bug go to:
https://bugs.launchpad.net/eglibc/+bug/582585/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to