iptables-nft: fix -Z option
Florian Westphal
maintainerPATCH 1/1 iptables-nft: fix -Z option
it zeroes the rule counters, so it needs fully populated cache. Add a test case to cover this.
Fixes 9d07514ac5c7a ("nft: calculate cache requirements from list of commands")
Signed-off-by Florian Westphal <[email protected]>
--- iptables/nft-cmd.c | 2 +- .../testcases/iptables/0007-zero-counters_0 | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100755 iptables/tests/shell/testcases/iptables/0007-zero-counters_0
iptables/nft-cmd.c +1 -1
@@ -185,7 +185,7 @@ int nft_cmd_chain_zero_counters(struct nft_handle *h, const char *chain,if (!cmd)return 0 ; -nft_cache_level_set (h,NFT_CL_CHAINS , cmd); +nft_cache_level_set (h,NFT_CL_RULES , cmd);return 1 ; }
iptables/tests/shell/testcases/iptables/0007-zero-counters_0 new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
2.26.2
Quoted 5 lines · Florian Westphal
it zeroes the rule counters, so it needs fully populated cache. Add a test case to cover this.
Fixes 9d07514ac5c7a ("nft: calculate cache requirements from list of commands")Signed-off-by Florian Westphal <[email protected]>
Acked-by Phil Sutter <[email protected]>
Thanks, Phil