提交 f97017cd 编写于 作者: J Jamal Hadi Salim 提交者: David S. Miller

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: NJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 34093d05
...@@ -790,6 +790,8 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid) ...@@ -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); err = a->ops->walk(skb, &dcb, RTM_DELACTION, a);
if (err < 0) if (err < 0)
goto nla_put_failure; goto nla_put_failure;
if (err == 0)
goto noflush_out;
nla_nest_end(skb, nest); nla_nest_end(skb, nest);
...@@ -807,6 +809,7 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid) ...@@ -807,6 +809,7 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
nlmsg_failure: nlmsg_failure:
module_put(a->ops->owner); module_put(a->ops->owner);
err_out: err_out:
noflush_out:
kfree_skb(skb); kfree_skb(skb);
kfree(a); kfree(a);
return err; return err;
...@@ -824,8 +827,10 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event) ...@@ -824,8 +827,10 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
return ret; return ret;
if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) { if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) {
if (tb[0] != NULL && tb[1] == NULL) if (tb[1] != NULL)
return tca_action_flush(tb[0], n, pid); return tca_action_flush(tb[1], n, pid);
else
return -EINVAL;
} }
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) { for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册