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) {
|
for ((downstream, value) in routings) if (value == null) {
|
||||||
// system tethering already has working forwarding rules
|
// system tethering already has working forwarding rules
|
||||||
// so it doesn't make sense to add additional 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 {
|
if (routing.start()) routings[downstream] = routing else {
|
||||||
failed = true
|
failed = true
|
||||||
routing.stop()
|
routing.stop()
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ class Routing(val upstream: String?, val downstream: String, ownerAddress: InetA
|
|||||||
|
|
||||||
fun dump() = loggerSu("""
|
fun dump() = loggerSu("""
|
||||||
|echo iptables
|
|echo iptables
|
||||||
|iptables-save
|
|sh -c 'exec -a iptables-save iptables'
|
||||||
|echo
|
|echo
|
||||||
|echo iptables -t nat
|
|echo iptables -t nat
|
||||||
|iptables-save -t nat
|
|sh -c 'exec -a iptables-save iptables -t nat'
|
||||||
|echo
|
|echo
|
||||||
|echo ip rule
|
|echo ip rule
|
||||||
|ip rule
|
|ip rule
|
||||||
|
|||||||
Reference in New Issue
Block a user