Properly support proper VPNs

It turns out that not using masquerade will not work with real VPNs (as opposed to dummy ones, including adblockers and sockifiers).

Fixes #10.
This commit is contained in:
Mygod
2018-03-08 00:41:50 -08:00
parent 4d58183168
commit c7e1abb585
3 changed files with 22 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ class TetheringService : Service(), VpnMonitor.Callback, IpNeighbourMonitor.Call
for ((downstream, value) in routings) if (value == null) try {
// 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().dnsRedirect(dns)
val routing = Routing(upstream, downstream).rule().forward().masquerade().dnsRedirect(dns)
if (routing.start()) routings[downstream] = routing else {
failed = true
routing.stop()