JDK-8223104 : JDWP support for IPv6
  • Type: CSR
  • Component: core-svc
  • Sub-Component: debugger
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-04-29
  • Updated: 2019-05-09
  • Resolved: 2019-05-09
Related Reports
CSR :  
Description
Summary
-------

Add IPv6 support for JPDA socket transport.

Problem
-------

Some parts of the world are moving to IPv6 only and we want our customers to continue to be able to debug their applications.
JDI side of the socket transport supports both IPv4 and IPv6, but the JDWP agent supports IPv4 only.
This makes impossible to use socket transport for debugging on IPv6 only systems.

Solution
--------

Add IPv6 support for JDWP agent.
The IPv4 will continue to be supported as before.

Specification
-------------

The JDWP agent options (-agentlib:jdwp=transport=dt_socket,...) are changed as follows:

 - address (address=[<address>]:<port>):
    - address can be IPv6 (in addition to IPv4);
    - as IPv6 address contains colons, the address can be enclosed in square brackets (example: [::1]:<port>)
    - if address is empty or a symbolic hostname is specified (like localhost) which can be resolved to either IPv4 or IPv6 IP address,
      the address is selected depending on standard java net system properties:
      - "java.net.preferIPv4Stack" (default: false) - use only IPv4 addresses;
      - "java.net.preferIPv6Addresses" (default: false) - IPv6 addresses are preferred;

     For compatibility, addresses are resolved to IPv4 by default, so old debuggers can connect to new target VMs.

 - allow (allow=<address1>[/<prefixLength1>]+<address2>[/<prefixLength2>]+...)
    - addresses can be either IPv4 or IPv6:
      - IPv4 addresses are 32bit, so IPv4 max prefixLength is 31
      - IPv6 addresses are 128bit, so IPv6 max prefixLength is 127

The following doc changes are required:

 - "allow" option needs to be documented (It has not been documented yet, see enhancement JDK-8221713 and related CSR JDK-8061228);

 - in "Connection and Invocation Details" (https://docs.oracle.com/en/java/javase/12/docs/specs/jpda/conninv.html) the following change is required:

<pre>
The socket transport uses a single stream TCP/IP connection
between the debugger application and the target VM. Both IPv4 and IPv6 are
-supported on the JDI side of the socket transport. The current implementation
-on the target VM side only supports IPv4, but this could change in a future
-release so that both IPv4 and IPv6 are supported.
+supported on the JDI side and the target VM side of the socket transport.
</pre>



Comments
Moving to Approved.
09-05-2019