Re: tc del class not working

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux