This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
getaddrinfo(AF_UNSPEC,AI_PASSIVE) result order
- From: Dimitrios Apostolou <jimis at gmx dot net>
- To: libc-help at sourceware dot org
- Date: Fri, 7 Jun 2013 21:50:33 +0200 (CEST)
- Subject: getaddrinfo(AF_UNSPEC,AI_PASSIVE) result order
Hello list,
getaddrinfo(AF_UNSPEC, AI_PASSIVE) on my RHEL 6.3 system returns first
0.0.0.0 and second ::0. However according to RFC 3484, paragraph 10.3:
The default policy table gives IPv6 addresses higher precedence than
IPv4 addresses. This means that applications will use IPv6 in
preference to IPv4 when the two are equally suitable. An
administrator can change the policy table to prefer IPv4 addresses by
giving the ::ffff:0.0.0.0/96 prefix a higher precedence:
The glibc resolver precedence is changed by tweaking /etc/gai.conf, which
is empty on this system. As a result my application listens only to
IPv4, even though IPv6 loopback works as expected:
# ping6 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.237 ms
What am I missing?
Thanks,
Dimitris