RFR[10]: JDK-8023649 - java.net.NetworkInterface.getInterfaceAddresses() call flow clean up

Mark Sheppard mark.sheppard at oracle.com
Tue Sep 12 17:20:12 UTC 2017


Hi,
     please oblige and review the follows changes:
http://cr.openjdk.java.net/~msheppar/8023649/webrev/

for the issue:
https://bugs.openjdk.java.net/browse/JDK-8023649

This is performed under the auspices of reliability, robustness and 
stability.
* As such, a number of error checks are amended to free malloc-ed memory,
* to add consistency to the code, additional ExceptionCheck have been 
added as a post  SetObjectArrayElement invocation check,
* A long standing issue reporting that 
NetworkInterface::getInterfacesAddresses can throw an NPE has been 
addressed.
The context for such a failure is that there is an IPv4 only 
configuration and that configuration is incorrect in its setting.
This may lead to the bindings array being allocated, but expected 
InterfaceAddress objects not allocated
and set in the array .... so the bindings array implicitly contains null 
references.

In NetworkInterface.c  the function
createNetworkInterface
performs a check on an address mask which may lead to skipping the code 
block handling the InterfaceAddress allocation.

regards
Mark


More information about the net-dev mailing list