Skip to contentSkip to conversation

: HFSC: fix thinko in hfsc_adjust_levels()

NET_SCHED Patrick McHardy 2 participants 2 messages May 11, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

[NET_SCHED]: HFSC: fix thinko in hfsc_adjust_levels()

When deleting the last child the level of a class should drop to zero.

Noticed by Andreas Mueller <[email protected]>

---
commit c75053e281212b5ed3990a0aaced865db7e456d2
tree be2c674d4545ea41200fc5c57d53a03cb0672a93
parent 0e44dc383787b472a7f13564c6bd8a44cc07d408
author Patrick McHardy <[email protected]> Thu, 11 May 2006 10:29:30 +0200 committer Patrick McHardy <[email protected]> Thu, 11 May 2006 10:29:30 +0200

 net/sched/sch_hfsc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
net/sched/sch_hfsc.c +3 -3
index 91132f6..f1c7bd2 100644
@@ -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);
 }