Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103603
b: refs/heads/master
c: 55dbc64
h: refs/heads/master
i:
  103601: 1592378
  103599: 2d2c648
v: v3
  • Loading branch information
David S. Miller committed Jul 18, 2008
1 parent 5121c54 commit 550ccf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17715e62a5e5c7224e5f906a4b8f9e5084100118
refs/heads/master: 55dbc640c31db373fa07eb1e3af9b8eadbdf80db
11 changes: 7 additions & 4 deletions trunk/net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
{
struct net *net = sock_net(skb->sk);
struct nlattr *tca[TCA_MAX + 1];
spinlock_t *root_lock;
struct tcmsg *t;
u32 protocol;
u32 prio;
Expand Down Expand Up @@ -204,6 +205,8 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
}
}

root_lock = qdisc_root_lock(q);

if (tp == NULL) {
/* Proto-tcf does not exist, create new one */

Expand Down Expand Up @@ -263,10 +266,10 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
goto errout;
}

qdisc_lock_tree(dev);
spin_lock_bh(root_lock);
tp->next = *back;
*back = tp;
qdisc_unlock_tree(dev);
spin_unlock_bh(root_lock);

} else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind))
goto errout;
Expand All @@ -275,9 +278,9 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)

if (fh == 0) {
if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) {
qdisc_lock_tree(dev);
spin_lock_bh(root_lock);
*back = tp->next;
qdisc_unlock_tree(dev);
spin_lock_bh(root_lock);

tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER);
tcf_destroy(tp);
Expand Down

0 comments on commit 550ccf4

Please sign in to comment.