Add option to turn off masquerade

It turns out that this option may not be necessary but I've already implemented it so just in case.
This commit is contained in:
Mygod
2018-06-16 00:20:17 +08:00
parent 4c101012ad
commit 538755f015
8 changed files with 29 additions and 5 deletions

View File

@@ -51,7 +51,9 @@ class TetheringService : IpNeighbourMonitoringService(), UpstreamMonitor.Callbac
if (value?.stop() == false) failed = true
// system tethering already has working forwarding rules
// so it doesn't make sense to add additional forwarding rules
val routing = Routing(upstream, downstream).rule().forward().masquerade().dnsRedirect(dns)
val routing = Routing(upstream, downstream).rule().forward()
if (app.masquerade) routing.masquerade()
routing.dnsRedirect(dns)
if (app.pref.getBoolean("service.disableIpv6", false)) routing.disableIpv6()
routings[downstream] = routing
if (!routing.start()) failed = true