mirror of https://github.com/M66B/NetGuard.git
Auto enable limited subnet routing on custom private DNS
This commit is contained in:
parent
93cd2008d2
commit
aacd96defd
|
@ -1274,6 +1274,16 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
}
|
||||
}
|
||||
|
||||
boolean calling = true;
|
||||
String dns_specifier = Util.getPrivateDnsSpecifier(ServiceSinkhole.this);
|
||||
if (!filter && !subnet && !TextUtils.isEmpty(dns_specifier)) {
|
||||
subnet = true;
|
||||
tethering = false;
|
||||
lan = false;
|
||||
calling = false;
|
||||
// always exclude broadcast
|
||||
}
|
||||
|
||||
// Subnet routing
|
||||
if (subnet) {
|
||||
// Exclude IP ranges
|
||||
|
@ -1302,7 +1312,6 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
if (dns instanceof Inet4Address)
|
||||
listExclude.add(new IPUtil.CIDR(dns.getHostAddress(), 32));
|
||||
|
||||
String dns_specifier = Util.getPrivateDnsSpecifier(ServiceSinkhole.this);
|
||||
if (!TextUtils.isEmpty(dns_specifier))
|
||||
try {
|
||||
Log.i(TAG, "Resolving private dns=" + dns_specifier);
|
||||
|
@ -1314,6 +1323,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
}
|
||||
}
|
||||
|
||||
if (calling) {
|
||||
// https://en.wikipedia.org/wiki/Mobile_country_code
|
||||
Configuration config = getResources().getConfiguration();
|
||||
|
||||
|
@ -1367,6 +1377,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
listExclude.add(new IPUtil.CIDR("75.192.0.0", 9)); // 75.192.0.0 - 75.255.255.255
|
||||
listExclude.add(new IPUtil.CIDR("97.0.0.0", 10)); // 97.0.0.0 - 97.63.255.255
|
||||
}
|
||||
}
|
||||
|
||||
// Broadcast
|
||||
listExclude.add(new IPUtil.CIDR("224.0.0.0", 3));
|
||||
|
|
Loading…
Reference in New Issue