RFR: 8275640 (win) java.net.NetworkInterface issues with IPv6-only environments [v4]

Daniel Jelinski duke at openjdk.java.net
Wed Jan 12 12:37:24 UTC 2022


On Wed, 12 Jan 2022 11:01:03 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

>> Daniel Jelinski has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove unused / incorrect exit code -2 from enumInterfaces
>
> src/java.base/windows/native/libnet/NetworkInterface.c line 216:
> 
>> 214:                 break;
>> 215:         }
>> 216:         return -1;
> 
> *netifPP = NULL;
> 
> and a similar NULL out value for all  return -1  in this function

Why?
No users of `enumInterfaces` rely on the value returned in the second parameter when `enumInterfaces` returns a negative result. The same is true for `getAllInterfacesAndAddresses`.
The second parameter was NULL-initialized in a few places; this initialization was not necessary and I just removed it to avoid confusion.

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

PR: https://git.openjdk.java.net/jdk/pull/6090


More information about the net-dev mailing list