(solaris) 8059309: network tests fail with "java.net.SocketException: Couldn't obtain phys addr" when run as "root"
Daniel Fuchs
daniel.fuchs at oracle.com
Fri Feb 28 15:41:51 UTC 2020
Hi,
Please find below a fix for:
8059309: network tests fail with "java.net.SocketException:
Couldn't obtain phys addr" when run as "root"
https://bugs.openjdk.java.net/browse/JDK-8059309
http://cr.openjdk.java.net/~dfuchs/webrev_8059309/webrev.00/
Recent reports have shown that the failure occurs when the tests
are run with super user privileges.
The NetworkInterface code on Solaris attempts to use the DLPI interface,
but this requires root privilege. If it fails to open the device, it
falls back to using the ARP tables instead.
Apparently using the DLPI interface to query the mac address from
the loopback isn't supported, which is causing the exception.
The fix is to examine the error status returned by the ACK
message and if that's DL_UNSUPPORTED, returns 0 to trigger the
fallback mechanism instead of throwing the socket exception.
best regards,
-- daniel
More information about the net-dev
mailing list