From 5c77e907211fcae37f59732331e4fbb5cdcc4d37 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 8 Aug 2024 16:06:42 +0200 Subject: [PATCH] Use iptables-save alongside explicit lists of tables This was inspired by the recent addition of the mangle table in iptables output for subctl gather. In addition to the current logging of manually-specified tables (in a format which is easy to read), it uses iptables-save to automatically determine all the active tables. This ensures that if a user's setup relies on other tables, developers can still determine what's happening without having to go back to the user to run additional iptables commands. Signed-off-by: Stephen Kitt --- internal/gather/cni.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/gather/cni.go b/internal/gather/cni.go index 0deff100..b3047b45 100644 --- a/internal/gather/cni.go +++ b/internal/gather/cni.go @@ -52,6 +52,7 @@ var ipTablesCmds = map[string]string{ "iptables": "iptables -L -n -v --line-numbers", "iptables-nat": "iptables -L -n -v --line-numbers -t nat", "iptables-mangle": "iptables -L -n -v --line-numbers -t mangle", + "iptables-save": "iptables-save -c", } var libreswanCmds = map[string]string{