JDK-4933803 : Behavior depending on optional IPv6 support from OS should be specified
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2003-10-07
  • Updated: 2017-05-16
  • Resolved: 2004-06-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b58Fixed
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
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b58 tiger-rc
17-07-2004

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
14-10-2003

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
09-10-2003