1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-27 18:30:09 +00:00

Filter loopback and any local DNS addresses

This commit is contained in:
M66B 2016-02-21 19:43:39 +01:00
parent 6abf1a42ed
commit 256344c187

View file

@ -871,7 +871,8 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
for (String def_dns : sysDns)
try {
InetAddress ddns = InetAddress.getByName(def_dns);
if (!listDns.contains(ddns))
if (!listDns.contains(ddns) &&
!(ddns.isLoopbackAddress() || ddns.isAnyLocalAddress()))
listDns.add(ddns);
} catch (Throwable ignored) {
}