From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Date: Wed, 10 May 2006 04:43:52 +0000 Subject: Re: [LARTC] tc del class not working Message-Id: <44616F88.4000304@trash.net> List-Id: References: <0633E0EDB4F25F43A2D7179CA11FAFAB25530F@xavier.staff.greatlakes.net> In-Reply-To: <0633E0EDB4F25F43A2D7179CA11FAFAB25530F@xavier.staff.greatlakes.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Andreas Mueller wrote: > I allways forget attachments. ;) > > > ------------------------------------------------------------------------ > > --- linux/net/sched/sch_hfsc.c~ 2006-01-15 07:16:02.000000000 +0100 > +++ linux/net/sched/sch_hfsc.c 2006-05-10 00:07:07.000000000 +0200 > @@ -970,14 +970,15 @@ > { > struct hfsc_class *p; > unsigned int level; > - > + int adj = 0; > do { > level = 0; > list_for_each_entry(p, &cl->children, siblings) { > if (p->level > level) > level = p->level; > + adj = 1; > } > - cl->level = level + 1; > + cl->level = level + adj; > } while ((cl = cl->cl_parent) != NULL); > } Nice catch, this could result in quite some undesirable behaviour. The unconditional + 1 seems to be a thinko originating in class addition. A slightly prettier fix would be to just change if (p->level > level) level = p->level to if (p->level >= level) level = p->level + 1 If you send me a patch which does that and a proper Signed-off-by: line I'll push it upstream for 2.6.17. _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc