]> err.no Git - linux-2.6/blobdiff - net/sched/cls_api.c
ipv6: syncookies: free reqsk on xfrm_lookup error
[linux-2.6] / net / sched / cls_api.c
index b483bbea611870a9b0955b7e857fae9bf8026ae7..d2b6f54a626191b33fa782bd262b279a02cd57ef 100644 (file)
@@ -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;
@@ -166,7 +167,7 @@ replay:
 
        /* Find qdisc */
        if (!parent) {
-               struct netdev_queue *dev_queue = &dev->tx_queue;
+               struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, 0);
                q = dev_queue->qdisc_sleeping;
                parent = q->handle;
        } else {
@@ -204,6 +205,8 @@ replay:
                }
        }
 
+       root_lock = qdisc_root_lock(q);
+
        if (tp == NULL) {
                /* Proto-tcf does not exist, create new one */
 
@@ -263,10 +266,10 @@ replay:
                        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;
@@ -275,9 +278,9 @@ replay:
 
        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);
@@ -410,7 +413,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
        if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
                return skb->len;
 
-       dev_queue = &dev->tx_queue;
+       dev_queue = netdev_get_tx_queue(dev, 0);
        if (!tcm->tcm_parent)
                q = dev_queue->qdisc_sleeping;
        else