RFR 6594296: NetworkInterface.getHardwareAddress returns zero length byte array
Chris Hegarty
chris.hegarty at oracle.com
Tue Apr 30 12:42:28 PDT 2013
This is a conformance issue where getHardwareAddress may incorrectly
return a zero length byte array, rather than null. The spec allows for
null, in fact it requires it for such cases. The issue is reproducible
with newer versions of Windows, with IPv6 enabled.
The problem is in src/windows/native/java/net/NetworkInterface_winXP.c.
PhysicalAddressLength can be 0, in which case the byte array should not
be created, rather than creating a 0 length byte[].
From msdn:
"PhysicalAddressLength
Type: DWORD
The length, in bytes, of the address specified in the
PhysicalAddress member. For interfaces that do not have
a data-link layer, this value is zero."
Webrev:
http://cr.openjdk.java.net/~chegar/6594296/webrev.00/webrev/
-Chris.
More information about the net-dev
mailing list