Do not assume iptables-save is available
This commit is contained in:
@@ -51,7 +51,7 @@ class TetheringService : Service(), VpnMonitor.Callback, IpNeighbourMonitor.Call
|
||||
for ((downstream, value) in routings) if (value == null) {
|
||||
// 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(true).dnsRedirect(dns)
|
||||
val routing = Routing(upstream, downstream).rule().forward().dnsRedirect(dns)
|
||||
if (routing.start()) routings[downstream] = routing else {
|
||||
failed = true
|
||||
routing.stop()
|
||||
|
||||
@@ -32,10 +32,10 @@ class Routing(val upstream: String?, val downstream: String, ownerAddress: InetA
|
||||
|
||||
fun dump() = loggerSu("""
|
||||
|echo iptables
|
||||
|iptables-save
|
||||
|sh -c 'exec -a iptables-save iptables'
|
||||
|echo
|
||||
|echo iptables -t nat
|
||||
|iptables-save -t nat
|
||||
|sh -c 'exec -a iptables-save iptables -t nat'
|
||||
|echo
|
||||
|echo ip rule
|
||||
|ip rule
|
||||
|
||||
Reference in New Issue
Block a user