summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2008-08-13 02:41:22 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-13 02:41:22 -0700
commitf97017cdefefdb6a0e19266024b0c6f9fd411eeb (patch)
treed223eabc477ff3bd172aac7dd9ab83e1566acf17 /net/sched
parent34093d055e09d1bb549efc11c8d448373437bbe4 (diff)
downloadblackbird-op-linux-f97017cdefefdb6a0e19266024b0c6f9fd411eeb.tar.gz
blackbird-op-linux-f97017cdefefdb6a0e19266024b0c6f9fd411eeb.zip
net-sched: Fix actions flushing
Flushing of actions has been broken since we changed the semantics of netlink parsed tb[X] to mean X is an attribute type. This makes the flushing work. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_api.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 26c7e1f9a350..88b57331d130 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -790,6 +790,8 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
err = a->ops->walk(skb, &dcb, RTM_DELACTION, a);
if (err < 0)
goto nla_put_failure;
+ if (err == 0)
+ goto noflush_out;
nla_nest_end(skb, nest);
@@ -807,6 +809,7 @@ nla_put_failure:
nlmsg_failure:
module_put(a->ops->owner);
err_out:
+noflush_out:
kfree_skb(skb);
kfree(a);
return err;
@@ -824,8 +827,10 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
return ret;
if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) {
- if (tb[0] != NULL && tb[1] == NULL)
- return tca_action_flush(tb[0], n, pid);
+ if (tb[1] != NULL)
+ return tca_action_flush(tb[1], n, pid);
+ else
+ return -EINVAL;
}
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
OpenPOWER on IntegriCloud