dect
/
linux-2.6
Archived
13
0
Fork 0

[PKT_SCHED]: GRED: Report out-of-bound DPs as illegal

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Thomas Graf 2005-11-05 21:14:14 +01:00 committed by Thomas Graf
parent 6639607ed9
commit a8aaa9958e
1 changed files with 3 additions and 6 deletions

View File

@ -451,12 +451,9 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
return -EINVAL;
ctl = RTA_DATA(tb[TCA_GRED_PARMS-1]);
if (ctl->DP > MAX_DPs-1 ) {
/* misbehaving is punished! Put in the default drop probability */
DPRINTK("\nGRED: DP %u not in the proper range fixed. New DP "
"set to default at %d\n",ctl->DP,table->def);
ctl->DP=table->def;
}
if (ctl->DP >= table->DPs)
return -EINVAL;
if (table->tab[ctl->DP] == NULL) {
table->tab[ctl->DP]=kmalloc(sizeof(struct gred_sched_data),