Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 187660 - ipv6 localhost, ::1, resolving before ipv4 localhost, 127.0.0.1, address
Summary: ipv6 localhost, ::1, resolving before ipv4 localhost, 127.0.0.1, address
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-03 22:00 UTC by benjamin fry
Modified: 2009-04-11 01:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fairly straight forward hosts file (hosts,705 bytes, text/plain)
2007-08-04 16:17 UTC, benjamin fry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benjamin fry 2007-08-03 22:00:32 UTC
all kde network applications are resolving and connecting to the ipv6 address for localhost, ::1, before the ipv4 address, 127.0.0.1.

This causes issues with some applications that listen on *:port, which by default opens a socket on the ipv6 interface even though those applications may have issues parsing ipv6 addresses, and thus don't support the connection on that address.

It seems that the order has changed in a recent patch to 3.5.7, is this configurable?

This seems to have begun after upgrading from 3.5.7 to 3.5.7_r2

Reproducible: Always

Steps to Reproduce:
1. Connect to a local server of any type from any KDE application (Kmail, Konqueror, etc...)
2. Check with netstat or some other tool to notice the connection uses the ipv6 address instead of ipv4 when using the name 'localhost'
3. This does NOT occur if you do the same test from the command line using telnet or some other application.  KDE should be respecting the naming difference between localhost and ip6-localhost

Actual Results:  
kde applications connect to the ipv6 localhost address

Expected Results:  
should first connect to the ipv4 address, and only that since there is no direct mapping in /etc/hosts for localhost to ipv6 ::1

Work around is to specify 127.0.0.1 instead of localhost.
Or use non-kde applications like Firefox instead in areas where local ipv6 is not acceptable.
Comment 1 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2007-08-04 00:57:53 UTC
Please attach your /etc/hosts file - you can remove any entries for hosts on your network, but leave the localhost and ipv6 entries in the correct order.
Comment 2 benjamin fry 2007-08-04 16:17:04 UTC
Created attachment 126863 [details]
fairly straight forward hosts file
Comment 3 benjamin fry 2007-08-04 16:19:45 UTC
I replaced some internal names with *** but left the fields in tact.  I don't believe this is an issue with my hosts file, this is basically a boiler plate version.

Again, it's only KDE network applications that are doing this, no other apps, i.e. telnet, firefox, etc.
Comment 4 benjamin fry 2007-08-07 00:01:54 UTC
Also, I tested this without any of the ipv6 entries in my hosts file with the same results.
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-06-04 10:19:13 UTC
Is this still happening with current kde version?
Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-04-11 01:13:20 UTC
I'm closing this one as we haven't got any feedback about it.
Anyone wanting to reopen this bug, please take a look at /etc/gai.conf as it allows ot configure the precedence for getaddrinfo