aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 59f2a58c1e32..d55d00c2a824 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2594,14 +2594,16 @@ static
2594int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, 2594int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write,
2595 void __user *buffer, size_t *lenp, loff_t *ppos) 2595 void __user *buffer, size_t *lenp, loff_t *ppos)
2596{ 2596{
2597 struct net *net = current->nsproxy->net_ns; 2597 struct net *net;
2598 int delay = net->ipv6.sysctl.flush_delay; 2598 int delay;
2599 if (write) { 2599 if (!write)
2600 proc_dointvec(ctl, write, buffer, lenp, ppos);
2601 fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
2602 return 0;
2603 } else
2604 return -EINVAL; 2600 return -EINVAL;
2601
2602 net = (struct net *)ctl->extra1;
2603 delay = net->ipv6.sysctl.flush_delay;
2604 proc_dointvec(ctl, write, buffer, lenp, ppos);
2605 fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
2606 return 0;
2605} 2607}
2606 2608
2607ctl_table ipv6_route_table_template[] = { 2609ctl_table ipv6_route_table_template[] = {
@@ -2688,6 +2690,7 @@ struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
2688 2690
2689 if (table) { 2691 if (table) {
2690 table[0].data = &net->ipv6.sysctl.flush_delay; 2692 table[0].data = &net->ipv6.sysctl.flush_delay;
2693 table[0].extra1 = net;
2691 table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh; 2694 table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh;
2692 table[2].data = &net->ipv6.sysctl.ip6_rt_max_size; 2695 table[2].data = &net->ipv6.sysctl.ip6_rt_max_size;
2693 table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval; 2696 table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval;