From: Phil Sutter Date: Wed, 9 Oct 2024 15:49:41 +0000 (+0200) Subject: ebtables: Fix for -S with rule number X-Git-Tag: v1.8.11~19 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d36046edada7a6cd4a619ac53496a6d74947f65;p=thirdparty%2Fiptables.git ebtables: Fix for -S with rule number 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 --- diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index 45663a3a..658cf4b9 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -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,