summaryrefslogtreecommitdiffstats
path: root/iptables/nft-cmd.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-02-24 11:08:02 +0100
committerFlorian Westphal <fw@strlen.de>2021-02-24 13:57:34 +0100
commit5f1fcacebf9b4529950b6e3f88327049a0ea7cd2 (patch)
tree2b621a177172a62f288b9b82f0fc073311cdef95 /iptables/nft-cmd.c
parentc94416573d8a97830aa1c9f8ea1bbbd17d4fddbe (diff)
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 <fw@strlen.de> Acked-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-cmd.c')
-rw-r--r--iptables/nft-cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft-cmd.c b/iptables/nft-cmd.c
index 5d33f1f0..f2b935c5 100644
--- a/iptables/nft-cmd.c
+++ b/iptables/nft-cmd.c
@@ -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;
}