mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-25 01:07:52 +00:00
Prevent crash
This commit is contained in:
parent
9011324e73
commit
da0ea8c95c
1 changed files with 7 additions and 6 deletions
|
@ -990,12 +990,13 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
|
||||
while (nis.hasMoreElements()) {
|
||||
NetworkInterface ni = nis.nextElement();
|
||||
for (InterfaceAddress ia : ni.getInterfaceAddresses())
|
||||
if (ia.getAddress() instanceof Inet4Address) {
|
||||
IPUtil.CIDR local = new IPUtil.CIDR(ia.getAddress(), ia.getNetworkPrefixLength());
|
||||
Log.i(TAG, "Excluding " + ni.getName() + " " + local);
|
||||
listExclude.add(local);
|
||||
}
|
||||
if (nis != null)
|
||||
for (InterfaceAddress ia : ni.getInterfaceAddresses())
|
||||
if (ia.getAddress() instanceof Inet4Address) {
|
||||
IPUtil.CIDR local = new IPUtil.CIDR(ia.getAddress(), ia.getNetworkPrefixLength());
|
||||
Log.i(TAG, "Excluding " + ni.getName() + " " + local);
|
||||
listExclude.add(local);
|
||||
}
|
||||
}
|
||||
} catch (SocketException ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
|
|
Loading…
Reference in a new issue