tailscale/wgengine
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>
2020-05-28 07:15:05 -04:00
..
filter wgengine/filter: implement a destination IP pre-filter. 2020-05-22 17:03:30 +00:00
magicsock magicsock: work around race condition initializing .Regions[]. 2020-05-28 03:42:03 -04:00
monitor wgengine/monitor: disable monitor on Android 2020-04-24 06:35:31 -07:00
packet wgengine/packet: add some tests, more docs, minor Go style, performance changes 2020-05-25 08:58:10 -07:00
router router_linux: remove need for iptables.ListChains(). 2020-05-28 07:15:05 -04:00
tstun tstun: tolerate zero reads 2020-05-27 14:32:09 -04:00
winnet Move Linux client & common packages into a public repo. 2020-02-09 09:32:57 -08:00
rusage_nowindows.go wgengine: flesh out some docs 2020-02-12 13:37:45 -08:00
rusage_windows.go Move Linux client & common packages into a public repo. 2020-02-09 09:32:57 -08:00
rusage.go Move "logger" package to under types, now that we have it. 2020-02-14 20:23:05 -08:00
userspace.go wgengine/packet: add some tests, more docs, minor Go style, performance changes 2020-05-25 08:58:10 -07:00
watchdog_test.go wgengine: wrap tun.Device to support filtering and packet injection (#358) 2020-05-13 09:16:17 -04:00
watchdog.go all: make client use server-provided DERP map, add DERP region support 2020-05-23 22:31:59 -07:00
wgengine.go all: make client use server-provided DERP map, add DERP region support 2020-05-23 22:31:59 -07:00