path: root/iptables/xtables-eb.c
diff options
authorPhil Sutter <>2019-01-15 23:23:04 +0100
committerPablo Neira Ayuso <>2019-01-18 02:42:08 +0100
commit5ca9acf51adf9dcc8e0d82cd8f5b9b2514f900ee (patch)
tree62295273bac218be53870f88dc46f527f5ec78d2 /iptables/xtables-eb.c
parent2b801fc515ae094d04207e840ed191196292b968 (diff)
xtables: Fix position of replaced rules in cache
When replacing a rule, the replacement was simply appended to the chain's rule list. Instead, insert it where the rule it replaces was. This also fixes for zero counters command to remove the old rule from cache. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'iptables/xtables-eb.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index 16d87412..b9d98a05 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -171,7 +171,7 @@ append_entry(struct nft_handle *h,
int ret = 1;
if (append)
- ret = nft_rule_append(h, chain, table, cs, 0, verbose);
+ ret = nft_rule_append(h, chain, table, cs, NULL, verbose);
ret = nft_rule_insert(h, chain, table, cs, rule_nr, verbose);