(solaris) 8059309: network tests fail with "java.net.SocketException: Couldn't obtain phys addr" when run as "root"
Bernd Eckenfels
ecki at zusammenkunft.net
Fri Feb 28 22:06:49 UTC 2020
What is the MAC address of the loopback interface on Solaris anyway? Maybe it's enough to assume there is none if the execution fails?
--
http://bernd.eckenfels.net
________________________________
Von: net-dev <net-dev-bounces at openjdk.java.net> im Auftrag von Daniel Fuchs <daniel.fuchs at oracle.com>
Gesendet: Friday, February 28, 2020 4:41:51 PM
An: OpenJDK Network Dev list <net-dev at openjdk.java.net>
Betreff: (solaris) 8059309: network tests fail with "java.net.SocketException: Couldn't obtain phys addr" when run as "root"
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200228/2d1afd98/attachment.htm>
More information about the net-dev
mailing list