Exclude broadcast address when allowing lan, route IPv6 unicast only

This commit is contained in:
M66B 2017-11-09 17:05:11 +01:00
parent eb4a7ff1f9
commit 605b0fb756
1 changed files with 3 additions and 2 deletions

View File

@ -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();