United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6882910 Unexplained lack of IP4 network ability when transparent IP6 to IP4 is disabled.
JDK-6882910 : Unexplained lack of IP4 network ability when transparent IP6 to IP4 is disabled.

Details
Type:
Enhancement
Submit Date:
2009-09-17
Status:
Closed
Updated Date:
2011-05-17
Project Name:
JDK
Resolved Date:
2011-05-17
Component:
core-libs
OS:
linux
Sub-Component:
java.net
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0,6u10
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
A DESCRIPTION OF THE REQUEST :
In Linux and BSD at least, the invisible forwarding of connections between IP6 and IP4 space can be disabled.  In at least 1 BSD, this is disabled by default for security reasons.
When this feature is disabled, the JRE loses its networking ability and there is no sign to the user of why.

In Linux, the feature can be disabled by the kernel setting
net.ipv6.bindv6only = 1
. This can be done by the sysctl utility as in
sysctl net.ipv6.bindv6only=1
. and disabled by
sysctl net.ipv6.bindv6only=0
.
 

JUSTIFICATION :
Make apparent to the user why JRE networking is not functioning.
Increase security.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There are at least 3 ways to address this.

The most desirable is to use IP4 or IP6 networking as appropriate for the network connection to be established.

The second is to give a more helpful error message to the user upon error. This may require more program logic.

The third option is to ship a description of the problem in installation or troubleshooting documentation.
ACTUAL -
An error message which does not bring the user close to being able to discover the cause.

In the case of runnig the appletviewer, it provides:
I/O exception while reading: Network is unreachable

Otherwise one often receives an exception message and stack trace.

---------- BEGIN SOURCE ----------
sysctl net.ipv6.bindv6only=1
appletviewer http://www.javatester.org/version.html

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
sysctl net.ipv6.bindv6only=0

                                    

Comments
EVALUATION

The IPv6 support in the JDK assumes dual-listener and support for IPv4 mapped addresses. IPv6 sockets are used by default if IPv6 is enabled and the implementation assumes that IPV6_V6ONLY defaults to 0. If distributions start shipping with this enabled then the JDK will need to be changed so that it sets this socket option to 0 (at socket create time).
                                     
2010-07-28
EVALUATION

Changeset: 1f996198877b
Author:    chegar
Date:      2010-08-10 17:30 +0100
URL:       http://hg.openjdk.java.net/jdk7/tl/jdk/rev/1f996198877b

6882910: Unexplained lack of IP4 network ability when transparent IP6 to IP4 is disabled.
Reviewed-by: alanb

! src/solaris/native/java/net/PlainDatagramSocketImpl.c
! src/solaris/native/java/net/PlainSocketImpl.c
! src/solaris/native/sun/nio/ch/Net.c
                                     
2010-08-10



Hardware and Software, Engineered to Work Together