netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] netfilter: nf_tables: attach replacement rule after stale one
@ 2013-09-17 22:14 Pablo Neira Ayuso
  2013-09-17 22:14 ` [PATCH 2/2] netfilter: nf_tables: do not allow deletion/replacement of stale rules Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-09-17 22:14 UTC (permalink / raw)
  To: netfilter-devel

Insert the new rule after the existing stale one that
will be removed in the commit phase.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 755d596..0e55e1b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1659,7 +1659,8 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
 		rupd = nf_tables_trans_add(old_rule, &ctx);
 		if (rupd == NULL)
 			goto err2;
-		list_add_tail_rcu(&rule->list, &chain->rules);
+
+		list_add_tail(&rule->list, &old_rule->list);
 	} else if (nlh->nlmsg_flags & NLM_F_APPEND)
 		if (old_rule)
 			list_add_rcu(&rule->list, &old_rule->list);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-17 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 22:14 [PATCH 1/2] netfilter: nf_tables: attach replacement rule after stale one Pablo Neira Ayuso
2013-09-17 22:14 ` [PATCH 2/2] netfilter: nf_tables: do not allow deletion/replacement of stale rules Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).