RFR: 8275640 (win) java.net.NetworkInterface issues with IPv6-only environments [v4]
Daniel Jelinski
duke at openjdk.java.net
Wed Jan 12 08:10:00 UTC 2022
On Mon, 10 Jan 2022 19:58:56 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:
>> In my experiments the `enumInterfaces` succeeded in IPv6-only environment. The function only fails with -2 when a new interface is added during enumeration.
>> I could modify the function to stop returning -2 if you think it makes sense.
>
> yes, that's what I have observed also It looks like the error handling in enumInterfaces is cut and paste from lookupIPAddrTable, as per the comment
>
> // this different error code is to handle the case when we call
> // GetIpAddrTable in pure IPv6 environment
> return -2;
> when in fact it is calling GetIfTable
>
> and if that returns an error, it seems reasonable to terminate processing at that stage by throwing an appropriate exception ... I can't see how it can continue
>
> So it would seems that enumInterfaces curennt return value -2 is misleading
Right. Removed. `enumInterfaces` returns -1 on all failures now.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6090
More information about the net-dev
mailing list