[NETNS][IPV6] udp6 - make proc per namespace

The proc init/exit functions take a new network namespace parameter in
order to register/unregister /proc/net/udp6 for a namespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Daniel Lezcano
2008-03-21 04:14:17 -07:00
committed by David S. Miller
parent f40c8174d3
commit 0c96d8c50b
7 changed files with 29 additions and 24 deletions

View File

@@ -842,6 +842,8 @@ static void cleanup_ipv6_mibs(void)
static int inet6_net_init(struct net *net)
{
int err = 0;
net->ipv6.sysctl.bindv6only = 0;
net->ipv6.sysctl.flush_delay = 0;
net->ipv6.sysctl.ip6_rt_max_size = 4096;
@@ -853,12 +855,20 @@ static int inet6_net_init(struct net *net)
net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
net->ipv6.sysctl.icmpv6_time = 1*HZ;
return 0;
#ifdef CONFIG_PROC_FS
err = udp6_proc_init(net);
if (err)
goto out;
out:
#endif
return err;
}
static void inet6_net_exit(struct net *net)
{
return;
#ifdef CONFIG_PROC_FS
udp6_proc_exit(net);
#endif
}
static struct pernet_operations inet6_net_ops = {
@@ -943,8 +953,6 @@ static int __init inet6_init(void)
goto proc_raw6_fail;
if (tcp6_proc_init())
goto proc_tcp6_fail;
if (udp6_proc_init())
goto proc_udp6_fail;
if (udplite6_proc_init())
goto proc_udplite6_fail;
if (ipv6_misc_proc_init())
@@ -1029,8 +1037,6 @@ proc_anycast6_fail:
proc_misc6_fail:
udplite6_proc_exit();
proc_udplite6_fail:
udp6_proc_exit();
proc_udp6_fail:
tcp6_proc_exit();
proc_tcp6_fail:
raw6_proc_exit();
@@ -1092,7 +1098,6 @@ static void __exit inet6_exit(void)
ac6_proc_exit();
ipv6_misc_proc_exit();
udplite6_proc_exit();
udp6_proc_exit();
tcp6_proc_exit();
raw6_proc_exit();
#endif