RFR: JDK-8313804: JDWP support for -Djava.net.preferIPv6Addresses=system [v3]
Chris Plummer
cjplummer at openjdk.org
Tue Sep 19 23:39:38 UTC 2023
On Tue, 19 Sep 2023 05:30:39 GMT, David Holmes <dholmes at openjdk.org> wrote:
> Okay I see now that `ai` is not important. We won't have set `listenAddr` so we will take the first `addrInfo`. But this seems somewhat random behaviour as the first `addrInfo` could be either V4 or V6 (what controls the order?). But we then execute the if at L748 regardless because the preferred value is not AF_INET even though the chosen address may still be a v4 address. This may all "just work" but I find it hard to discern what the correct/expected behaviour is if using `system` (which seems to mean "don't care").
The only time `listenAddr` is not set is when using AF_UNSPEC ("system"). In this case the proper thing to do is grab the first entry, since this is the entry that the "system" prefers that we use. It could be v4 or v6. I think Alex has commented that this can be made more obvious with a check for AF_UNSPEC.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15796#issuecomment-1726681974
More information about the serviceability-dev
mailing list