aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorMichal Kubeček <mkubecek@suse.cz>2013-08-01 10:04:24 +0200
committerBen Hutchings <ben@decadent.org.uk>2015-10-13 03:46:13 +0100
commit24277c76396d5ff90832f0a60c6c5987566256ea (patch)
tree0a5e19097261f82c6ea0492ae80823e03ce5c099 /net/ipv6/route.c
parent2491f0184830c5f1e1c794283177179937def4b7 (diff)
downloadkernel_samsung_smdk4412-24277c76396d5ff90832f0a60c6c5987566256ea.zip
kernel_samsung_smdk4412-24277c76396d5ff90832f0a60c6c5987566256ea.tar.gz
kernel_samsung_smdk4412-24277c76396d5ff90832f0a60c6c5987566256ea.tar.bz2
ipv6: update ip6_rt_last_gc every time GC is run
commit 49a18d86f66d33a20144ecb5a34bba0d1856b260 upstream. As pointed out by Eric Dumazet, net->ipv6.ip6_rt_last_gc should hold the last time garbage collector was run so that we should update it whenever fib6_run_gc() calls fib6_clean_all(), not only if we got there from ip6_dst_gc(). Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 716a711..3a8776d 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1159,7 +1159,6 @@ static void icmp6_clean_all(int (*func)(struct rt6_info *rt, void *arg),
static int ip6_dst_gc(struct dst_ops *ops)
{
- unsigned long now = jiffies;
struct net *net = container_of(ops, struct net, ipv6.ip6_dst_ops);
int rt_min_interval = net->ipv6.sysctl.ip6_rt_gc_min_interval;
int rt_max_size = net->ipv6.sysctl.ip6_rt_max_size;
@@ -1169,13 +1168,12 @@ static int ip6_dst_gc(struct dst_ops *ops)
int entries;
entries = dst_entries_get_fast(ops);
- if (time_after(rt_last_gc + rt_min_interval, now) &&
+ if (time_after(rt_last_gc + rt_min_interval, jiffies) &&
entries <= rt_max_size)
goto out;
net->ipv6.ip6_rt_gc_expire++;
fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, entries > rt_max_size);
- net->ipv6.ip6_rt_last_gc = now;
entries = dst_entries_get_slow(ops);
if (entries < ops->gc_thresh)
net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1;