diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index a998db6e7895..e7db7014e89f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -739,8 +739,10 @@ restart: | |||
739 | 739 | ||
740 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) | 740 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) |
741 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); | 741 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); |
742 | else | 742 | else if (!(rt->dst.flags & DST_HOST)) |
743 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); | 743 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); |
744 | else | ||
745 | goto out2; | ||
744 | 746 | ||
745 | dst_release(&rt->dst); | 747 | dst_release(&rt->dst); |
746 | rt = nrt ? : net->ipv6.ip6_null_entry; | 748 | rt = nrt ? : net->ipv6.ip6_null_entry; |
@@ -2557,14 +2559,16 @@ static | |||
2557 | int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, | 2559 | int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, |
2558 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2560 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2559 | { | 2561 | { |
2560 | struct net *net = current->nsproxy->net_ns; | 2562 | struct net *net; |
2561 | int delay = net->ipv6.sysctl.flush_delay; | 2563 | int delay; |
2562 | if (write) { | 2564 | if (!write) |
2563 | proc_dointvec(ctl, write, buffer, lenp, ppos); | ||
2564 | fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net); | ||
2565 | return 0; | ||
2566 | } else | ||
2567 | return -EINVAL; | 2565 | return -EINVAL; |
2566 | |||
2567 | net = (struct net *)ctl->extra1; | ||
2568 | delay = net->ipv6.sysctl.flush_delay; | ||
2569 | proc_dointvec(ctl, write, buffer, lenp, ppos); | ||
2570 | fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net); | ||
2571 | return 0; | ||
2568 | } | 2572 | } |
2569 | 2573 | ||
2570 | ctl_table ipv6_route_table_template[] = { | 2574 | ctl_table ipv6_route_table_template[] = { |
@@ -2651,6 +2655,7 @@ struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net) | |||
2651 | 2655 | ||
2652 | if (table) { | 2656 | if (table) { |
2653 | table[0].data = &net->ipv6.sysctl.flush_delay; | 2657 | table[0].data = &net->ipv6.sysctl.flush_delay; |
2658 | table[0].extra1 = net; | ||
2654 | table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh; | 2659 | table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh; |
2655 | table[2].data = &net->ipv6.sysctl.ip6_rt_max_size; | 2660 | table[2].data = &net->ipv6.sysctl.ip6_rt_max_size; |
2656 | table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval; | 2661 | table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval; |