Support strict mode for system tethering

TODO: Set up rules when upstream interface not found.
This commit is contained in:
Mygod
2018-09-03 16:37:54 +08:00
parent 0342d97fb0
commit 89c26fe384
6 changed files with 13 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ class LocalOnlyInterfaceManager(val downstream: String) : UpstreamMonitor.Callba
try {
this.dns = dns
this.routing = Routing(upstream, downstream, owner).apply {
val strict = app.pref.getBoolean("service.repeater.strict", false)
val strict = app.strict
if (strict && upstream == null) return@apply // in this case, nothing to be done
if (app.dhcpWorkaround) dhcpWorkaround()
ipForward() // local only interfaces need to enable ip_forward