From 605b0fb7563d9d394dcd967ffe9004726e277d16 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 9 Nov 2017 17:05:11 +0100 Subject: [PATCH] Exclude broadcast address when allowing lan, route IPv6 unicast only --- app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java index b84147d0..966e28b1 100644 --- a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java +++ b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java @@ -1322,7 +1322,8 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS } start = IPUtil.plus1(exclude.getEnd()); } - for (IPUtil.CIDR include : IPUtil.toCIDR("224.0.0.0", "255.255.255.255")) + String end = (lan ? "255.255.255.254" : "255.255.255.255"); + for (IPUtil.CIDR include : IPUtil.toCIDR("224.0.0.0", end)) try { builder.addRoute(include.address, include.prefix); } catch (Throwable ex) { @@ -1336,7 +1337,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS Log.i(TAG, "IPv6=" + ip6); if (ip6) - builder.addRoute("0:0:0:0:0:0:0:0", 0); + builder.addRoute("2000::", 3); // unicast // MTU int mtu = jni_get_mtu();