]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/cls_u32.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
[linux.git] / net / sched / cls_u32.c
index 66c6bcec16cbc2e06f1e356a3a114a8154bb55a4..e15ff335953deef36e55901d8f4ce34e15ed676f 100644 (file)
@@ -1108,33 +1108,10 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
        return err;
 }
 
-static bool u32_hnode_empty(struct tc_u_hnode *ht, bool *non_root_ht)
-{
-       int i;
-
-       if (!ht)
-               return true;
-       if (!ht->is_root) {
-               *non_root_ht = true;
-               return false;
-       }
-       if (*non_root_ht)
-               return false;
-       if (ht->refcnt < 2)
-               return true;
-
-       for (i = 0; i <= ht->divisor; i++) {
-               if (rtnl_dereference(ht->ht[i]))
-                       return false;
-       }
-       return true;
-}
-
 static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
                     bool rtnl_held)
 {
        struct tc_u_common *tp_c = tp->data;
-       bool non_root_ht = false;
        struct tc_u_hnode *ht;
        struct tc_u_knode *n;
        unsigned int h;
@@ -1147,8 +1124,6 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
             ht = rtnl_dereference(ht->next)) {
                if (ht->prio != tp->prio)
                        continue;
-               if (u32_hnode_empty(ht, &non_root_ht))
-                       return;
                if (arg->count >= arg->skip) {
                        if (arg->fn(tp, ht, arg) < 0) {
                                arg->stop = 1;
@@ -1280,12 +1255,17 @@ static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
        return 0;
 }
 
-static void u32_bind_class(void *fh, u32 classid, unsigned long cl)
+static void u32_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
+                          unsigned long base)
 {
        struct tc_u_knode *n = fh;
 
-       if (n && n->res.classid == classid)
-               n->res.class = cl;
+       if (n && n->res.classid == classid) {
+               if (cl)
+                       __tcf_bind_filter(q, &n->res, base);
+               else
+                       __tcf_unbind_filter(q, &n->res);
+       }
 }
 
 static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,