Commit 73b38711 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[NETNS]: Register /proc/net/rt_cache for each namespace.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a75e936f
...@@ -545,7 +545,7 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset, ...@@ -545,7 +545,7 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
} }
#endif #endif
static __init int ip_rt_proc_init(struct net *net) static int __net_init ip_rt_do_proc_init(struct net *net)
{ {
struct proc_dir_entry *pde; struct proc_dir_entry *pde;
...@@ -576,8 +576,26 @@ err2: ...@@ -576,8 +576,26 @@ err2:
err1: err1:
return -ENOMEM; return -ENOMEM;
} }
static void __net_exit ip_rt_do_proc_exit(struct net *net)
{
remove_proc_entry("rt_cache", net->proc_net_stat);
remove_proc_entry("rt_cache", net->proc_net);
remove_proc_entry("rt_acct", net->proc_net);
}
static struct pernet_operations ip_rt_proc_ops __net_initdata = {
.init = ip_rt_do_proc_init,
.exit = ip_rt_do_proc_exit,
};
static int __init ip_rt_proc_init(void)
{
return register_pernet_subsys(&ip_rt_proc_ops);
}
#else #else
static inline int ip_rt_proc_init(struct net *net) static inline int ip_rt_proc_init(void)
{ {
return 0; return 0;
} }
...@@ -3055,7 +3073,7 @@ int __init ip_rt_init(void) ...@@ -3055,7 +3073,7 @@ int __init ip_rt_init(void)
ip_rt_secret_interval; ip_rt_secret_interval;
add_timer(&rt_secret_timer); add_timer(&rt_secret_timer);
if (ip_rt_proc_init(&init_net)) if (ip_rt_proc_init())
printk(KERN_ERR "Unable to create route proc files\n"); printk(KERN_ERR "Unable to create route proc files\n");
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
xfrm_init(); xfrm_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment