ipn: plumb NetfilterMode all the way out to the CLI.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
		 David Anderson
					David Anderson
				
			
				
					committed by
					
						 Dave Anderson
						Dave Anderson
					
				
			
			
				
	
			
			
			 Dave Anderson
						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