RFR: JDK-8184770: JDWP support for IPv6

Alex Menkov alexey.menkov at oracle.com
Wed Mar 27 23:04:37 UTC 2019


Hi all,

Please review the fix for
https://bugs.openjdk.java.net/browse/JDK-8184770
webrev:
http://cr.openjdk.java.net/~amenkov/IPv6/webrev.00/

Main changes are in socketTransport.c - the code is updated to support 
both IPv4 and IPv6.
Some details to simplify reviewing:
- listening:
   - if IP address is specified (like 127.0.0.1 or ::1), connector 
listens only on this address;
   - for backward compatibility if no address (or "localhost") is 
specified, IPv4 is used (if supported by the host);
   - if "*" is specified (means "listen on all local interfaces"), dual 
mode socket is used to listen on both IPv6 and IPv4 addresses;
   - AllowedPeerInfo structure (for "allow" option) is updated to use 
IPv6 address/mask, support for IPv4 is implemented by using "mapped" 
IPv4 addresses;
- attaching: agent resolves and tries to connect to all (IPv4 and IPv6) 
addresses, IPv4 are tried first;

SocketListeningConnector.java/SocketTransportService.java are updated to 
support IPv6 addresses (the addresses may contain colons);

new JdwpAttachTest.java/JdwpListenTest.java test that listening and 
attaching works for all available addresses (Ipv4 and IPv6)

BasicJDWPConnectionTest.java was renamed to JdwpAllowTest.java (as it 
tests "allow" functionality), tests for mask (prefix length) 
functionality are added (for both IPv4 and IPv6);

--alex


More information about the serviceability-dev mailing list