[iptables PATCH 1/3] ebtables: Fix for -S with rule number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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 ff364ec76191f..08c9cbf0ead72 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -623,7 +623,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.43.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux