I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit db86850d authored by zzz's avatar zzz
Browse files

Addresses: Catch a rare (Windows only? IPv6 only?) error

when enumerating network interfaces
parent 97ae1e50
No related branches found
No related tags found
No related merge requests found
...@@ -131,7 +131,15 @@ public abstract class Addresses { ...@@ -131,7 +131,15 @@ public abstract class Addresses {
} }
} }
} }
} catch (SocketException e) {} } catch (SocketException e) {
} catch (java.lang.Error e) {
// Windows, possibly when IPv6 only...
// https://bugs.openjdk.java.net/browse/JDK-8046500
// java.lang.Error: IP Helper Library GetIfTable function failed
// at java.net.NetworkInterface.getAll(Native Method)
// at java.net.NetworkInterface.getNetworkInterfaces(Unknown Source)
// at net.i2p.util.Addresses.getAddresses ...
}
if (includeLoopbackAndWildcard) { if (includeLoopbackAndWildcard) {
if (haveIPv4) if (haveIPv4)
......
...@@ -40,6 +40,14 @@ abstract class MTU { ...@@ -40,6 +40,14 @@ abstract class MTU {
ifcs = NetworkInterface.getNetworkInterfaces(); ifcs = NetworkInterface.getNetworkInterfaces();
} catch (SocketException se) { } catch (SocketException se) {
return 0; return 0;
} catch (java.lang.Error e) {
// Windows, possibly when IPv6 only...
// https://bugs.openjdk.java.net/browse/JDK-8046500
// java.lang.Error: IP Helper Library GetIfTable function failed
// at java.net.NetworkInterface.getAll(Native Method)
// at java.net.NetworkInterface.getNetworkInterfaces(Unknown Source)
// at net.i2p.util.Addresses.getAddresses ...
return 0;
} }
if (ifcs != null) { if (ifcs != null) {
while (ifcs.hasMoreElements()) { while (ifcs.hasMoreElements()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment