Skip to content

Commit

Permalink
[PKT_SCHED]: sch_netem: correctly order packets to be sent simultaneo…
Browse files Browse the repository at this point in the history
…usly

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 <a.bittau@cs.ucl.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrea Bittau authored and David S. Miller committed Nov 20, 2005
1 parent 252ec9e commit aa87516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit aa87516

Please sign in to comment.