From 256344c187a776d3d2d766da140336e8055d7efa Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Feb 2016 19:43:39 +0100 Subject: [PATCH] Filter loopback and any local DNS addresses --- app/src/main/java/eu/faircode/netguard/SinkholeService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index 577ef5c5..5203c02d 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -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) { }