RFR: JDK-8184770: JDWP support for IPv6

Alex Menkov alexey.menkov at oracle.com
Fri Mar 29 22:07:20 UTC 2019


(added net-dev as suggested by Alan)

Net gurus, please assist in reviewing socket-related code.

New webrev:
http://cr.openjdk.java.net/~amenkov/IPv6/webrev.01/


On 03/28/2019 07:44, Gary Adams wrote:
> Is there any documentation that needs to be updated along with the impl 
> changes?

created an issue for this:
https://bugs.openjdk.java.net/browse/JDK-8221707

> 
> Would it make sense to support the preference properties?
>    java.net.preferIPv4Stack
>    java.net.preferIPv6Addresses

Done (with new test for the functionality)

> 
> Will the previous jdwp tests run with IPv6 or just the new additions?

many tests use "localhost" (or empty string which has the same meaning) 
address. localhost can be resolved to IPv4 or IPv6 address, but by 
default IPv4 is used.
So IPv6 will be used only on IPv6-only systems.

> 
> Should probably have reviewers with networking expertise. core-libs(?)
> 
> Do we know if IPv6 is enabled in our test infrastructure?

Accordingly the logs IPv6 stack is enabled, but no external IPv6 address 
is assigned (i.e. the only IPv6 address is loopback - ::1). This is 
enough for testing.

> 
> A stray "printf" statement in the initial webrev. socketTransport.c

fixed.

--alex

> 
> On 3/27/19, 7:04 PM, Alex Menkov wrote:
>> 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