RFR: 8302659: Modernize Windows native code for NetworkInterface [v3]

Rich DiCroce duke at openjdk.org
Wed Feb 22 17:40:44 UTC 2023


On Fri, 17 Feb 2023 20:51:35 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Though it's more complicated than that. Some machines may have both IPv6 and IPv4, some machine may only have IPv4, and some machine may only have IPv6. I haven't looked at the test yet, but picking up the right interface on the various platforms has always been an issue for our tests.
>
> So,, apparently this is a Windows feature. [Older socket implementation](https://github.com/openjdk/jdk11/blob/37115c8ea4aff13a8148ee2b8832b20888a5d880/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c#L1350) had an explicit check for addresses bound to an interface, and only interfaces with associated addresses could be used for multicasting.
> 
> This needs to be fixed in the test. Can you add a check for addresses to `OptionsTest.getNetworkInterface`?
> 
> Beyond that, I'm fine with an implementation that unconditionally returns `true`.

I've adjusted OptionsTest as @djelinski suggested, and changed the implementation to always return true. I left the giant comment so that when future devs wonder WTF we were thinking, they'll have the answer.

-------------

PR: https://git.openjdk.org/jdk/pull/12593



More information about the build-dev mailing list