mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
fixed Issue 243
This commit is contained in:
parent
f5c3494723
commit
d7e6b4560c
1 changed files with 7 additions and 6 deletions
|
@ -183,12 +183,13 @@ public class Connection {
|
|||
NetworkInterface iface = interfaces.nextElement( );
|
||||
if (iface.isLoopback())
|
||||
continue;
|
||||
for (InterfaceAddress addr: iface.getInterfaceAddresses())
|
||||
{
|
||||
InetAddress iaddr = addr.getAddress();
|
||||
if (iaddr instanceof Inet4Address) {
|
||||
return iaddr;
|
||||
}
|
||||
for (InterfaceAddress addr: iface.getInterfaceAddresses()) {
|
||||
if (addr != null) {
|
||||
InetAddress iaddr = addr.getAddress();
|
||||
if (iaddr != null && iaddr instanceof Inet4Address) {
|
||||
return iaddr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue