From 0c96d8c50bffb7f02690dd8a8cf1adb8e07e100f Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Fri, 21 Mar 2008 04:14:17 -0700 Subject: [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 Signed-off-by: David S. Miller --- net/ipv6/af_inet6.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'net/ipv6/af_inet6.c') diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 730a861b8f4..e3e09147d13 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -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 -- cgit v1.2.3