diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-23 19:27:04 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 07:27:47 +0200 |
commit | 76d643cd3bd2b4a1e27e3eafee8e37be9c681792 (patch) | |
tree | de8ede0c0700755caf16ca9d3dc4dba06075984d /net/sched | |
parent | [NETFILTER] nfnetlink: netlink_run_queue() already checks for NLM_F_REQUEST (diff) | |
download | linux-76d643cd3bd2b4a1e27e3eafee8e37be9c681792.tar.xz linux-76d643cd3bd2b4a1e27e3eafee8e37be9c681792.zip |
[NET_SCHED]: sch_netem: fix off-by-one in send time comparison
netem checks PSCHED_TLESS(cb->time_to_send, now) to find out whether it is
allowed to send a packet, which is equivalent to cb->time_to_send < now.
Use !PSCHED_TLESS(now, cb->time_to_send) instead to properly handle
cb->time_to_send == now.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_netem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 3e1b633e8b0d..bc4284396fcb 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -286,7 +286,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) /* if more time remaining? */ PSCHED_GET_TIME(now); - if (PSCHED_TLESS(cb->time_to_send, now)) { + if (!PSCHED_TLESS(now, cb->time_to_send)) { pr_debug("netem_dequeue: return skb=%p\n", skb); sch->q.qlen--; return skb; |