netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] act_mirred: avoid calling tcf_hash_release() when binding
@ 2015-07-31  0:12 Cong Wang
  2015-07-31  0:12 ` [Patch net] act_pedit: check binding before calling tcf_hash_release() Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cong Wang @ 2015-07-31  0:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, Cong Wang, Jamal Hadi Salim, Daniel Borkmann, Cong Wang

When we share an action within a filter, the bind refcnt
should increase, therefore we should not call tcf_hash_release().

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
---
 net/sched/act_mirred.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index a42a3b2..2685450 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -98,6 +98,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
 			return ret;
 		ret = ACT_P_CREATED;
 	} else {
+		if (bind)
+			return 0;
 		if (!ovr) {
 			tcf_hash_release(a, bind);
 			return -EEXIST;
-- 
1.8.3.1

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

end of thread, other threads:[~2015-08-03 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31  0:12 [Patch net] act_mirred: avoid calling tcf_hash_release() when binding Cong Wang
2015-07-31  0:12 ` [Patch net] act_pedit: check binding before calling tcf_hash_release() Cong Wang
2015-07-31 11:10   ` Daniel Borkmann
2015-07-31 22:23   ` David Miller
2015-07-31 10:06 ` [Patch net] act_mirred: avoid calling tcf_hash_release() when binding Daniel Borkmann
2015-07-31 22:25   ` Cong Wang
2015-07-31 22:33     ` Daniel Borkmann
2015-08-03 21:13 ` David Miller

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).