From: Andrea Bittau Date: Sun, 20 Nov 2005 21:41:05 +0000 (-0800) Subject: [PKT_SCHED]: sch_netem: correctly order packets to be sent simultaneously X-Git-Tag: v2.6.15-rc4~106^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa8751667dcd757dd9a711b51140adf181501c44;p=platform%2Fkernel%2Flinux-exynos.git [PKT_SCHED]: sch_netem: correctly order packets to be sent simultaneously If two packets were queued to be sent at the same time in the future, their order would be reversed. This would occur because the queue is traversed back to front, and a position is found by checking whether the new packet needs to be sent before the packet being examined. If the new packet is to be sent at the same time of a previous packet, it would end up before the old packet in the queue. This patch places packets in the correct order when they are queued to be sent at a same time in the future. Signed-off-by: Andrea Bittau Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index cdc8d28..82fb07a 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -464,7 +464,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) const struct netem_skb_cb *cb = (const struct netem_skb_cb *)skb->cb; - if (PSCHED_TLESS(cb->time_to_send, ncb->time_to_send)) + if (!PSCHED_TLESS(ncb->time_to_send, cb->time_to_send)) break; }