[bug] sun.nio.ch.PipeImpl uses IPv4

ecki at zusammenkunft.net ecki at zusammenkunft.net
Thu Dec 3 22:30:25 UTC 2015


I think this is somewhat intentional: potential broken localhost resolve or resolve of 127.0.0.1 vs. ::1 are just a bunch of causes for problems (and delays) which are all avoided by hardcoding the address family and address. However it causes now problems when systems are migrating to v6only.

At least the v4 vs. V6 problem is quite real... the best would be of course to avoid AFINET completely ,) Having said that a stabel InetAddress for a (working!) Loopback which is v6 aware would be nice (for other purposes).

Bernd

-- 
http://bernd.eckenfels.net

-----Original Message-----
From: Matthias-Christian Ott <ott at mirix.org>
To: core-libs-dev at openjdk.java.net
Sent: Do., 03 Dez. 2015 14:05
Subject: [bug] sun.nio.ch.PipeImpl uses IPv4

Expected behaviour:

If you assume that sun.nio.ch.PipeImpl communicates over local TCP/IP
sockets, PipeImpl should open a socket on and connect to over localhost.

Actual behaviour:

sun.nio.ch.PipeImpl open a socket on and connects to 127.0.0.1.

Suggested fix:

sun.nio.ch.PipeImpl should use localhost instead of 127.0.0.1. RFC 6761
states that "[users] may assume that IPv4 and IPv6 address queries for
localhost names will always resolve to the respective IP loopback
address". This assumption is correct on all supported versions of
Microsoft Windows (in non-broken configurations).



More information about the core-libs-dev mailing list