Commit d68d64f0 authored by Max Lv's avatar Max Lv

fix an issue

parent 765bf837
...@@ -274,18 +274,25 @@ class ShadowVpnService extends VpnService { ...@@ -274,18 +274,25 @@ class ShadowVpnService extends VpnService {
}) })
} else { } else {
for (i <- 1 to 254) { for (i <- 1 to 254) {
val addr = i.toString + ".0.0.0" if (i != 26 && i != 127) {
val cidr = addr + "/8" val addr = i.toString + ".0.0.0"
val net = new SubnetUtils(cidr).getInfo val cidr = addr + "/8"
if (!net.isInRange(proxy_address)) { val net = new SubnetUtils(cidr).getInfo
if (!InetAddress.getByName(addr).isSiteLocalAddress) builder.addRoute(addr, 8)
} else { if (!net.isInRange(proxy_address)) {
for (j <- 0 to 255) { if (!InetAddress.getByName(addr).isSiteLocalAddress) {
val addr = i.toString + "." + j.toString + ".0.0" builder.addRoute(addr, 8)
val cidr = addr + "/16" }
val net = new SubnetUtils(cidr).getInfo } else {
if (!net.isInRange(proxy_address)) { for (j <- 0 to 255) {
if (!InetAddress.getByName(addr).isSiteLocalAddress) builder.addRoute(addr, 16) val subAddr = i.toString + "." + j.toString + ".0.0"
val subCidr = subAddr + "/16"
val subNet = new SubnetUtils(subCidr).getInfo
if (!subNet.isInRange(proxy_address)) {
if (!InetAddress.getByName(subAddr).isSiteLocalAddress) {
builder.addRoute(subAddr, 16)
}
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment