This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: getaddrinfo(AF_UNSPEC,AI_PASSIVE) result order
- From: Godmar Back <godmar at gmail dot com>
- To: Dimitrios Apostolou <jimis at gmx dot net>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Fri, 7 Jun 2013 21:00:26 -0400
- Subject: Re: getaddrinfo(AF_UNSPEC,AI_PASSIVE) result order
- References: <alpine dot DEB dot 2 dot 02 dot 1306072135460 dot 4513 at localhost>
See
http://sourceware.org/ml/libc-help/2011-12/msg00000.html
http://sourceware.org/ml/libc-help/2013-03/msg00002.html
On Fri, Jun 7, 2013 at 3:50 PM, Dimitrios Apostolou <jimis@gmx.net> wrote:
> 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
>