You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/wgengine/router
Avery Pennarun a496cdc943 router_linux: remove need for iptables.ListChains().
Instead of retrieving the list of chains, or the list of rules in a
chain, just try deleting the ones we don't want and then adding the
ones we do want. An error in flushing/deleting still means the rule
doesn't exist anymore, so there was no need to check for it first.

This avoids the need to parse iptables output, which avoids the need to
ever call iptables -S, which fixes #403, among other things. It's also
much more future proof in case the iptables command line changes.

Unfortunately the iptables go module doesn't properly pass the iptables
command exit code back up when doing .Delete(), so we can't correctly
check the exit code there. (exit code 1 really means the rule didn't
exist, rather than some other weird problem).

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
6 years ago
..
ifconfig_windows.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
router.go ipn: plumb NetfilterMode all the way out to the CLI. 6 years ago
router_darwin.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
router_darwin_support.go router_darwin_support: we can build this on every platform. 6 years ago
router_default.go wgengine/router: split out from wgengine. 6 years ago
router_fake.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
router_freebsd.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
router_linux.go router_linux: remove need for iptables.ListChains(). 6 years ago
router_linux_test.go router_linux: remove need for iptables.ListChains(). 6 years ago
router_openbsd.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
router_windows.go wgengine/router: rename config.Settings to config.Config, make pointer. 6 years ago
runner.go router_linux: remove need for iptables.ListChains(). 6 years ago