Skip to content

Commit c8a4522

Browse files
Stephen Hemmingerdavem330
authored andcommitted
ipv6: use round_jiffies
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 417f28b commit c8a4522

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/ipv6/ip6_fib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,9 @@ void fib6_run_gc(unsigned long expires, struct net *net)
14621462
fib6_clean_all(net, fib6_age, 0, NULL);
14631463

14641464
if (gc_args.more)
1465-
mod_timer(&net->ipv6.ip6_fib_timer, jiffies +
1466-
net->ipv6.sysctl.ip6_rt_gc_interval);
1465+
mod_timer(&net->ipv6.ip6_fib_timer,
1466+
round_jiffies(jiffies
1467+
+ net->ipv6.sysctl.ip6_rt_gc_interval));
14671468
else
14681469
del_timer(&net->ipv6.ip6_fib_timer);
14691470
spin_unlock_bh(&fib6_gc_lock);

0 commit comments

Comments
 (0)