]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Fix for -S with rule number
authorPhil Sutter <phil@nwl.cc>
Wed, 9 Oct 2024 15:49:41 +0000 (17:49 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 16 Oct 2024 13:34:50 +0000 (15:34 +0200)
For NFT_COMPAT_RULE_SAVE, one has to store the rule number, not its
index in nft_cmd object.

Fixes: 58d364c7120b5 ("ebtables: Use do_parse() from xshared")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-eb.c

index 45663a3ad0ee0bd3fe1d12a88eb6a4951a51b63b..658cf4b98c04dcc92ae307cbe2a677b8d29e71ae 100644 (file)
@@ -619,7 +619,7 @@ int do_commandeb(struct nft_handle *h, int argc, char *argv[], char **table,
                                         cs.options&OPT_LIST_C);
                else if (p.command & CMD_LIST_RULES)
                        ret = nft_cmd_rule_list_save(h, p.chain, p.table,
-                                                    p.rulenum - 1,
+                                                    p.rulenum,
                                                     cs.options & OPT_VERBOSE);
                if (ret && (p.command & CMD_ZERO))
                        ret = nft_cmd_chain_zero_counters(h, p.chain, p.table,