Skip to content

Commit

Permalink
[NET_SCHED]: sch_htb: fix event cache time calculation
Browse files Browse the repository at this point in the history
The event cache time must be an absolute value, when no event exists
it is incorrectly set to 1s instead of 1s in the future.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed May 24, 2007
1 parent 1b07a95 commit 2e4b3b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,9 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)

if (q->now >= q->near_ev_cache[level]) {
event = htb_do_events(q, level);
q->near_ev_cache[level] = event ? event :
PSCHED_TICKS_PER_SEC;
if (!event)
event = q->now + PSCHED_TICKS_PER_SEC;
q->near_ev_cache[level] = event;
} else
event = q->near_ev_cache[level];

Expand Down

0 comments on commit 2e4b3b0

Please sign in to comment.