mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-27 07:38:49 +00:00
ipn: plumb NetfilterMode all the way out to the CLI.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:

committed by
Dave Anderson

parent
c67c8913c3
commit
0fe262f093
@@ -718,6 +718,24 @@ func (r *linuxRouter) delNetfilterHooks() error {
|
||||
del := func(table, chain string) error {
|
||||
tsChain := tsChain(chain)
|
||||
|
||||
chains, err := r.ipt4.ListChains(table)
|
||||
if err != nil {
|
||||
return fmt.Errorf("listing iptables chains: %v", err)
|
||||
}
|
||||
found := false
|
||||
for _, chain := range chains {
|
||||
if chain == tsChain {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
// The divert rule can't exist if the chain doesn't exist,
|
||||
// and querying for a jump to a non-existent chain errors
|
||||
// out.
|
||||
return nil
|
||||
}
|
||||
|
||||
args := []string{"-j", tsChain}
|
||||
exists, err := r.ipt4.Exists(table, chain, args...)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user