Skip to content

Commit

Permalink
ipv6: use round_jiffies
Browse files Browse the repository at this point in the history
This timer normally happens once a minute, there is no need to cause an
early wakeup for it, so align it to next second boundary to safe power.
It can't be deferred because then it could take too long on cleanup or DoS.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jul 22, 2008
1 parent 417f28b commit c8a4522
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,9 @@ void fib6_run_gc(unsigned long expires, struct net *net)
fib6_clean_all(net, fib6_age, 0, NULL);

if (gc_args.more)
mod_timer(&net->ipv6.ip6_fib_timer, jiffies +
net->ipv6.sysctl.ip6_rt_gc_interval);
mod_timer(&net->ipv6.ip6_fib_timer,
round_jiffies(jiffies
+ net->ipv6.sysctl.ip6_rt_gc_interval));
else
del_timer(&net->ipv6.ip6_fib_timer);
spin_unlock_bh(&fib6_gc_lock);
Expand Down

0 comments on commit c8a4522

Please sign in to comment.