From 4d36046edada7a6cd4a619ac53496a6d74947f65 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 9 Oct 2024 17:49:41 +0200 Subject: [PATCH] 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 --- iptables/xtables-eb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.47.2