United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4933803 Behavior depending on optional IPv6 support from OS should be specified
JDK-4933803 : Behavior depending on optional IPv6 support from OS should be specified

Details
Type:
Bug
Submit Date:
2003-10-07
Status:
Resolved
Updated Date:
2004-06-24
Project Name:
JDK
Resolved Date:
2004-06-24
Component:
core-libs
OS:
solaris_7
Sub-Component:
java.net
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (b58)

Related Reports

Sub Tasks

Description
Currently, there is no statement in the spec regarding the behavior if IPv6
addresses are not supported in underlying OS. It makes it difficult for
developers to write applications using IPv6 addresses while taking into account
that IPv6 may not be supported in OS.

The behavior of latest implementation shows that IOException will be thrown when
a Socket connection is made using an IPv6 address if the OS does not support
IPv6:

java.net.ConnectException: connect: Address is invalid on local machine, or port
 is not valid on remote machine
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:348)
        at java.net.Socket.connect(Socket.java:505)
        at java.net.Socket.connect(Socket.java:455)
        at java.net.Socket.<init>(Socket.java:363)
        at java.net.Socket.<init>(Socket.java:178)

Such behavior should be specified in java.net package level description as well
as the constructor of Socket.

                                    

Comments
EVALUATION

Behavior if IPv6 addresses are not suppported in the underlying OS
should be specified in java.net package level description as well
as the constructor of Socket.

###@###.### 2003-10-09

Yes, we should document what happens when IPv6 addresses are used on a machine that doesn't have an IPv6 stack.

###@###.### 2003-10-17
                                     
2003-10-09
SUGGESTED FIX

Besides the statement about exceptions in Socket constructor javadoc and package
overview, I am wondering whether we can use some system property to 
define whether IPv6 Socket connection is supported. This will benefit the
developers as they will know answer before they try the connection.

###@###.### 2003-10-14

Using system property to define optionality is a practice in J2ME. One example
is Personal Basis Profile. See

/java/re/pbp-spec/1.0/promoted/latest/ws/pbp-spec/doc-files/properties.html

It is desirable for J2SE to use the same approach as J2ME to achieve consistency
accross all Java platforms on defining optionality/restrictions.

The name of the system property used for IPv6 optionality could be 
java.net.Inet6Address.isConnectionUnsupported. If undefined or other than
"true", full support of IPv6 socket connection is assumed.

###@###.### 2003-10-14
                                     
2003-10-14
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-rc

FIXED IN:
tiger-rc

INTEGRATED IN:
tiger-b58
tiger-rc


                                     
2004-07-17



Hardware and Software, Engineered to Work Together