#298 try filtering out network interfaces that have no associated MAC addresses

This commit is contained in:
Anton Keks 2021-12-31 18:06:50 +02:00
parent bf97480532
commit f6f5031bfd

View File

@ -167,6 +167,10 @@ public class InetAddressUtils {
.filter(i -> i.getParent() == null && !i.isVirtual()).collect(toList());
for (NetworkInterface networkInterface : interfaces) {
try {
if (networkInterface.getHardwareAddress() == null) continue;
} catch (SocketException ignore) {}
for (InterfaceAddress ifAddr : networkInterface.getInterfaceAddresses()) {
anyAddress = ifAddr;
InetAddress addr = ifAddr.getAddress();