route.c (f3db48517f59133610f558f29de8834d7b007691) route.c (5b7c931dff03621ae7ac524c4fa280d4e5f187a4)
1/*
2 * Linux INET6 implementation
3 * FIB front-end.
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * $Id: route.c,v 1.56 2001/10/31 21:55:55 davem Exp $

--- 26 unchanged lines hidden (view full) ---

35#include <linux/net.h>
36#include <linux/route.h>
37#include <linux/netdevice.h>
38#include <linux/in6.h>
39#include <linux/init.h>
40#include <linux/if_arp.h>
41#include <linux/proc_fs.h>
42#include <linux/seq_file.h>
1/*
2 * Linux INET6 implementation
3 * FIB front-end.
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * $Id: route.c,v 1.56 2001/10/31 21:55:55 davem Exp $

--- 26 unchanged lines hidden (view full) ---

35#include <linux/net.h>
36#include <linux/route.h>
37#include <linux/netdevice.h>
38#include <linux/in6.h>
39#include <linux/init.h>
40#include <linux/if_arp.h>
41#include <linux/proc_fs.h>
42#include <linux/seq_file.h>
43#include <linux/nsproxy.h>
43#include <net/net_namespace.h>
44#include <net/snmp.h>
45#include <net/ipv6.h>
46#include <net/ip6_fib.h>
47#include <net/ip6_route.h>
48#include <net/ndisc.h>
49#include <net/addrconf.h>
50#include <net/tcp.h>

--- 939 unchanged lines hidden (view full) ---

990 static unsigned long last_gc;
991 unsigned long now = jiffies;
992
993 if (time_after(last_gc + init_net.ipv6.sysctl.ip6_rt_gc_min_interval, now) &&
994 atomic_read(&ip6_dst_ops.entries) <= init_net.ipv6.sysctl.ip6_rt_max_size)
995 goto out;
996
997 expire++;
44#include <net/net_namespace.h>
45#include <net/snmp.h>
46#include <net/ipv6.h>
47#include <net/ip6_fib.h>
48#include <net/ip6_route.h>
49#include <net/ndisc.h>
50#include <net/addrconf.h>
51#include <net/tcp.h>

--- 939 unchanged lines hidden (view full) ---

991 static unsigned long last_gc;
992 unsigned long now = jiffies;
993
994 if (time_after(last_gc + init_net.ipv6.sysctl.ip6_rt_gc_min_interval, now) &&
995 atomic_read(&ip6_dst_ops.entries) <= init_net.ipv6.sysctl.ip6_rt_max_size)
996 goto out;
997
998 expire++;
998 fib6_run_gc(expire);
999 fib6_run_gc(expire, &init_net);
999 last_gc = now;
1000 if (atomic_read(&ip6_dst_ops.entries) < ip6_dst_ops.gc_thresh)
1001 expire = init_net.ipv6.sysctl.ip6_rt_gc_timeout>>1;
1002
1003out:
1004 expire -= expire>>init_net.ipv6.sysctl.ip6_rt_gc_elasticity;
1005 return (atomic_read(&ip6_dst_ops.entries) > init_net.ipv6.sysctl.ip6_rt_max_size);
1006}

--- 1401 unchanged lines hidden (view full) ---

2408#endif /* CONFIG_PROC_FS */
2409
2410#ifdef CONFIG_SYSCTL
2411
2412static
2413int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
2414 void __user *buffer, size_t *lenp, loff_t *ppos)
2415{
1000 last_gc = now;
1001 if (atomic_read(&ip6_dst_ops.entries) < ip6_dst_ops.gc_thresh)
1002 expire = init_net.ipv6.sysctl.ip6_rt_gc_timeout>>1;
1003
1004out:
1005 expire -= expire>>init_net.ipv6.sysctl.ip6_rt_gc_elasticity;
1006 return (atomic_read(&ip6_dst_ops.entries) > init_net.ipv6.sysctl.ip6_rt_max_size);
1007}

--- 1401 unchanged lines hidden (view full) ---

2409#endif /* CONFIG_PROC_FS */
2410
2411#ifdef CONFIG_SYSCTL
2412
2413static
2414int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
2415 void __user *buffer, size_t *lenp, loff_t *ppos)
2416{
2416 int delay = init_net.ipv6.sysctl.flush_delay;
2417 struct net *net = current->nsproxy->net_ns;
2418 int delay = net->ipv6.sysctl.flush_delay;
2417 if (write) {
2418 proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
2419 if (write) {
2420 proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
2419 fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay);
2421 fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
2420 return 0;
2421 } else
2422 return -EINVAL;
2423}
2424
2425ctl_table ipv6_route_table_template[] = {
2426 {
2427 .procname = "flush",

--- 173 unchanged lines hidden ---
2422 return 0;
2423 } else
2424 return -EINVAL;
2425}
2426
2427ctl_table ipv6_route_table_template[] = {
2428 {
2429 .procname = "flush",

--- 173 unchanged lines hidden ---