]> git.hungrycats.org Git - linux/commitdiff
[PATCH] NET_SCHED: prio qdisc boundary condition
authorJamal Hadi Salim <hadi@cyberus.ca>
Tue, 15 May 2007 08:23:46 +0000 (01:23 -0700)
committerChris Wright <chrisw@sous-sol.org>
Wed, 23 May 2007 21:32:51 +0000 (14:32 -0700)
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/sched/sch_prio.c

index de889f23f22a5fdb29481c6696957e0832f95170..a86f36b07375ecb7898cb43b40db6626b79091e2 100644 (file)
@@ -74,7 +74,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];