]> err.no Git - linux-2.6/commitdiff
[NET_SCHED]: HFSC: fix thinko in hfsc_adjust_levels()
authorPatrick McHardy <kaber@trash.net>
Thu, 11 May 2006 19:22:03 +0000 (12:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 May 2006 19:22:03 +0000 (12:22 -0700)
When deleting the last child the level of a class should drop to zero.

Noticed by Andreas Mueller <andreas@stapelspeicher.org>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_hfsc.c

index 91132f6871d76ee42fa4e9dc53fcf643b32b779d..f1c7bd29f2cdc3932941c86e529426923484dee1 100644 (file)
@@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl)
        do {
                level = 0;
                list_for_each_entry(p, &cl->children, siblings) {
-                       if (p->level > level)
-                               level = p->level;
+                       if (p->level >= level)
+                               level = p->level + 1;
                }
-               cl->level = level + 1;
+               cl->level = level;
        } while ((cl = cl->cl_parent) != NULL);
 }