IPv4 addresses come sorted before IPv6 ones if you ask libc in teredo environment.

Bug #584243 reported by Inox
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

In Teredo case IPv4 addresses come sorted before the IPv6 ones (in contrast to native environment) if you
ask libc.

Results of getaddr1 and getaddr2 (both included as source and Debian/Ubuntu binary):

Native:

getaddr1 localhost
::1
127.0.0.1

getaddr2 localhost
::1
127.0.0.1

getaddr1 ip6.me
2001:4810::110
66.117.47.214

getaddr2 ip6.me
2001:4810::110
66.117.47.214

Teredo:

getaddr1 localhost
::1
127.0.0.1

getaddr2 localhost
::1
127.0.0.1

getaddr1 ip6.me
66.117.47.214
2001:4810::110

getaddr2 ip6.me
66.117.47.214
2001:4810::110

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: libc-bin 2.11.1-0ubuntu7
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Sat May 22 17:15:32 2010
Dependencies:

InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
ProcEnviron:
 LANGUAGE=en
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: eglibc

Revision history for this message
Inox (inox) wrote :
Revision history for this message
Inox (inox) wrote :
Revision history for this message
Tollef Fog Heen (tfheen) wrote :

Yes, this is intentional behaviour, teredo addresses have lower reliability than native v6 mechanisms and in general lower than ipv4, so it makes sense to give them lower priority too.

Changed in eglibc (Ubuntu):
status: New → Invalid
Revision history for this message
Kalle Valo (kvalo) wrote :

It's the same issue with 6to4 tunnel as well. I was wondering why my applications don't use ipv6 and I also found that getaddinfo() is returning ipv4 addresses before ipv6. So my 6to4 tunnel is useless because applications don't use ipv6 unless I explicitly instruct them to do so (eg. use ssh -6 or hostnames like www.ipv6.sixxs.net). If I added a native ipv6 address (for test purposes) getaddrinfo() started returning ipv6 address before ipv4. Last year (when I still used debian unstable) this wasn't the case, all applications were using ipv6 even though I had 6to4 tunnel. Is this a ubuntu specific modification or a new feature in glibc?

I don't really understand the reasoning here. Native ipv6 connections can be unreliable just like 6to4 tunnels are, it just depends how good the network administrators are. For example, my 6to4 anycast address goes to a gateway provided by Funet (Finnish University and Research Network) and is of very good quality. I don't recall having any problems with the tunnel or the gateway during all those years I have been using them (which must be over five years), all the ipv6 problems have been elsewhere in the ipv6 network.

In my opinion, if a user has gone all the trouble of creating an ipv6 tunnel, be it 6to4 or teredo, libc should honour that and prefer ipv6.

Revision history for this message
Inox (inox) wrote :

I got the authoritative answer from glibc team and unfortunately we have to treat such a behavior as "feature" rather than a "bug".

Revision history for this message
Kalle Valo (kvalo) wrote :

I did some research and found bug #555210 which changed to the behaviour reported here. Here's a workaround:

https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/555210/comments/10

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.