netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next] sched, act: allow to clear all actions as well
@ 2014-04-25 20:55 Cong Wang
  2014-04-26 11:40 ` Jamal Hadi Salim
  2014-04-28  3:42 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2014-04-25 20:55 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, Jamal Hadi Salim, David S. Miller, Cong Wang

From: Cong Wang <cwang@twopensource.com>

When we change the list of action on a given filter, currently we don't
change it to empty. This is a bug, we should allow to change to whatever
users given.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
---
 net/sched/cls_api.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 6786130..a481bbe 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -544,14 +544,12 @@ void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
 		     struct tcf_exts *src)
 {
 #ifdef CONFIG_NET_CLS_ACT
-	if (!list_empty(&src->actions)) {
-		LIST_HEAD(tmp);
-		tcf_tree_lock(tp);
-		list_splice_init(&dst->actions, &tmp);
-		list_splice(&src->actions, &dst->actions);
-		tcf_tree_unlock(tp);
-		tcf_action_destroy(&tmp, TCA_ACT_UNBIND);
-	}
+	LIST_HEAD(tmp);
+	tcf_tree_lock(tp);
+	list_splice_init(&dst->actions, &tmp);
+	list_splice(&src->actions, &dst->actions);
+	tcf_tree_unlock(tp);
+	tcf_action_destroy(&tmp, TCA_ACT_UNBIND);
 #endif
 }
 EXPORT_SYMBOL(tcf_exts_change);
-- 
1.8.3.1

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

* Re: [Patch net-next] sched, act: allow to clear all actions as well
  2014-04-25 20:55 [Patch net-next] sched, act: allow to clear all actions as well Cong Wang
@ 2014-04-26 11:40 ` Jamal Hadi Salim
  2014-04-28  3:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jamal Hadi Salim @ 2014-04-26 11:40 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller, Cong Wang

On 04/25/14 16:55, Cong Wang wrote:
> From: Cong Wang <cwang@twopensource.com>
>
> When we change the list of action on a given filter, currently we don't
> change it to empty. This is a bug, we should allow to change to whatever
> users given.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Cong Wang <cwang@twopensource.com>


Thanks Cong.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

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

* Re: [Patch net-next] sched, act: allow to clear all actions as well
  2014-04-25 20:55 [Patch net-next] sched, act: allow to clear all actions as well Cong Wang
  2014-04-26 11:40 ` Jamal Hadi Salim
@ 2014-04-28  3:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-04-28  3:42 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, jhs, cwang

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Fri, 25 Apr 2014 13:55:30 -0700

> From: Cong Wang <cwang@twopensource.com>
> 
> When we change the list of action on a given filter, currently we don't
> change it to empty. This is a bug, we should allow to change to whatever
> users given.
> 
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Cong Wang <cwang@twopensource.com>

Applied.

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

end of thread, other threads:[~2014-04-28  3:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 20:55 [Patch net-next] sched, act: allow to clear all actions as well Cong Wang
2014-04-26 11:40 ` Jamal Hadi Salim
2014-04-28  3:42 ` 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).