Add netd masquerade mode

This commit is contained in:
Mygod
2019-02-01 21:06:22 +08:00
parent 1dd8a9dcb6
commit f1973116ca
9 changed files with 84 additions and 37 deletions

View File

@@ -69,10 +69,8 @@ class TetheringService : IpNeighbourMonitoringService() {
try {
routings[downstream] = Routing(downstream).apply {
try {
// system tethering already has working forwarding rules
// so it doesn't make sense to add additional forwarding rules
forward()
if (app.masquerade) masquerade()
masquerade(Routing.masquerade)
if (disableIpv6) disableIpv6()
commit()
} catch (e: Exception) {