Skip to content

Commit

Permalink
[NET_SCHED]: prio qdisc boundary condition
Browse files Browse the repository at this point in the history
This fixes an out-of-boundary condition when the classified
band equals q->bands. Caught by Alexey

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jamal Hadi Salim authored and David S. Miller committed May 14, 2007
1 parent 6253db0 commit 3e5c2d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
band = res.classid;
}
band = TC_H_MIN(band) - 1;
if (band > q->bands)
if (band >= q->bands)
return q->queues[q->prio2band[0]];

return q->queues[band];
Expand Down

0 comments on commit 3e5c2d3

Please sign in to comment.