]> git.hungrycats.org Git - linux/commitdiff
[PKT_SCHED]: Fix u32 double listing.
authorPatrick McHardy <kaber@trash.net>
Tue, 8 Feb 2005 12:24:20 +0000 (04:24 -0800)
committerDavid S. Miller <davem@kernel.bkbits.net>
Tue, 8 Feb 2005 12:24:20 +0000 (04:24 -0800)
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c

index 8b870402bc96a259cea9670f6ba1690c2a53899a..821d3b9c5c55b151a3f1f1b3eed432f5f77b420c 100644 (file)
@@ -91,6 +91,7 @@ struct tc_u_hnode
 {
        struct tc_u_hnode       *next;
        u32                     handle;
+       u32                     prio;
        struct tc_u_common      *tp_c;
        int                     refcnt;
        unsigned                divisor;
@@ -323,6 +324,7 @@ static int u32_init(struct tcf_proto *tp)
        root_ht->divisor = 0;
        root_ht->refcnt++;
        root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000;
+       root_ht->prio = tp->prio;
 
        if (tp_c == NULL) {
                tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL);
@@ -587,6 +589,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
                ht->refcnt = 0;
                ht->divisor = divisor;
                ht->handle = handle;
+               ht->prio = tp->prio;
                ht->next = tp_c->hlist;
                tp_c->hlist = ht;
                *arg = (unsigned long)ht;
@@ -703,6 +706,8 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg)
                return;
 
        for (ht = tp_c->hlist; ht; ht = ht->next) {
+               if (ht->prio != tp->prio)
+                       continue;
                if (arg->count >= arg->skip) {
                        if (arg->fn(tp, (unsigned long)ht, arg) < 0) {
                                arg->stop = 1;