aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d9b40248b97f..a770df2493d2 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -932,10 +932,8 @@ static void rt_secret_rebuild_oneshot(struct net *net)
932{ 932{
933 del_timer_sync(&net->ipv4.rt_secret_timer); 933 del_timer_sync(&net->ipv4.rt_secret_timer);
934 rt_cache_invalidate(net); 934 rt_cache_invalidate(net);
935 if (ip_rt_secret_interval) { 935 if (ip_rt_secret_interval)
936 net->ipv4.rt_secret_timer.expires += ip_rt_secret_interval; 936 mod_timer(&net->ipv4.rt_secret_timer, jiffies + ip_rt_secret_interval);
937 add_timer(&net->ipv4.rt_secret_timer);
938 }
939} 937}
940 938
941static void rt_emergency_hash_rebuild(struct net *net) 939static void rt_emergency_hash_rebuild(struct net *net)
@@ -3103,22 +3101,20 @@ static void rt_secret_reschedule(int old)
3103 rtnl_lock(); 3101 rtnl_lock();
3104 for_each_net(net) { 3102 for_each_net(net) {
3105 int deleted = del_timer_sync(&net->ipv4.rt_secret_timer); 3103 int deleted = del_timer_sync(&net->ipv4.rt_secret_timer);
3104 long time;
3106 3105
3107 if (!new) 3106 if (!new)
3108 continue; 3107 continue;
3109 3108
3110 if (deleted) { 3109 if (deleted) {
3111 long time = net->ipv4.rt_secret_timer.expires - jiffies; 3110 time = net->ipv4.rt_secret_timer.expires - jiffies;
3112 3111
3113 if (time <= 0 || (time += diff) <= 0) 3112 if (time <= 0 || (time += diff) <= 0)
3114 time = 0; 3113 time = 0;
3115
3116 net->ipv4.rt_secret_timer.expires = time;
3117 } else 3114 } else
3118 net->ipv4.rt_secret_timer.expires = new; 3115 time = new;
3119 3116
3120 net->ipv4.rt_secret_timer.expires += jiffies; 3117 mod_timer(&net->ipv4.rt_secret_timer, jiffies + time);
3121 add_timer(&net->ipv4.rt_secret_timer);
3122 } 3118 }
3123 rtnl_unlock(); 3119 rtnl_unlock();
3124} 3120}