aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2008-03-21 07:14:17 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-21 07:14:17 -0400
commit0c96d8c50bffb7f02690dd8a8cf1adb8e07e100f (patch)
tree9add3d8686b41aa3022b49d9cc57710865245e26 /net/ipv6
parentf40c8174d3c21bf178283f3ef3aa8c7bf238fdec (diff)
[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>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c19
-rw-r--r--net/ipv6/udp.c8
-rw-r--r--net/ipv6/udplite.c4
3 files changed, 18 insertions, 13 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 730a861b8f41..e3e09147d134 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -842,6 +842,8 @@ static void cleanup_ipv6_mibs(void)
842 842
843static int inet6_net_init(struct net *net) 843static int inet6_net_init(struct net *net)
844{ 844{
845 int err = 0;
846
845 net->ipv6.sysctl.bindv6only = 0; 847 net->ipv6.sysctl.bindv6only = 0;
846 net->ipv6.sysctl.flush_delay = 0; 848 net->ipv6.sysctl.flush_delay = 0;
847 net->ipv6.sysctl.ip6_rt_max_size = 4096; 849 net->ipv6.sysctl.ip6_rt_max_size = 4096;
@@ -853,12 +855,20 @@ static int inet6_net_init(struct net *net)
853 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; 855 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
854 net->ipv6.sysctl.icmpv6_time = 1*HZ; 856 net->ipv6.sysctl.icmpv6_time = 1*HZ;
855 857
856 return 0; 858#ifdef CONFIG_PROC_FS
859 err = udp6_proc_init(net);
860 if (err)
861 goto out;
862out:
863#endif
864 return err;
857} 865}
858 866
859static void inet6_net_exit(struct net *net) 867static void inet6_net_exit(struct net *net)
860{ 868{
861 return; 869#ifdef CONFIG_PROC_FS
870 udp6_proc_exit(net);
871#endif
862} 872}
863 873
864static struct pernet_operations inet6_net_ops = { 874static struct pernet_operations inet6_net_ops = {
@@ -943,8 +953,6 @@ static int __init inet6_init(void)
943 goto proc_raw6_fail; 953 goto proc_raw6_fail;
944 if (tcp6_proc_init()) 954 if (tcp6_proc_init())
945 goto proc_tcp6_fail; 955 goto proc_tcp6_fail;
946 if (udp6_proc_init())
947 goto proc_udp6_fail;
948 if (udplite6_proc_init()) 956 if (udplite6_proc_init())
949 goto proc_udplite6_fail; 957 goto proc_udplite6_fail;
950 if (ipv6_misc_proc_init()) 958 if (ipv6_misc_proc_init())
@@ -1029,8 +1037,6 @@ proc_anycast6_fail:
1029proc_misc6_fail: 1037proc_misc6_fail:
1030 udplite6_proc_exit(); 1038 udplite6_proc_exit();
1031proc_udplite6_fail: 1039proc_udplite6_fail:
1032 udp6_proc_exit();
1033proc_udp6_fail:
1034 tcp6_proc_exit(); 1040 tcp6_proc_exit();
1035proc_tcp6_fail: 1041proc_tcp6_fail:
1036 raw6_proc_exit(); 1042 raw6_proc_exit();
@@ -1092,7 +1098,6 @@ static void __exit inet6_exit(void)
1092 ac6_proc_exit(); 1098 ac6_proc_exit();
1093 ipv6_misc_proc_exit(); 1099 ipv6_misc_proc_exit();
1094 udplite6_proc_exit(); 1100 udplite6_proc_exit();
1095 udp6_proc_exit();
1096 tcp6_proc_exit(); 1101 tcp6_proc_exit();
1097 raw6_proc_exit(); 1102 raw6_proc_exit();
1098#endif 1103#endif
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index d6e311f6c8eb..af619d48ba80 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -989,13 +989,13 @@ static struct udp_seq_afinfo udp6_seq_afinfo = {
989 .seq_fops = &udp6_seq_fops, 989 .seq_fops = &udp6_seq_fops,
990}; 990};
991 991
992int __init udp6_proc_init(void) 992int udp6_proc_init(struct net *net)
993{ 993{
994 return udp_proc_register(&udp6_seq_afinfo); 994 return udp_proc_register(net, &udp6_seq_afinfo);
995} 995}
996 996
997void udp6_proc_exit(void) { 997void udp6_proc_exit(struct net *net) {
998 udp_proc_unregister(&udp6_seq_afinfo); 998 udp_proc_unregister(net, &udp6_seq_afinfo);
999} 999}
1000#endif /* CONFIG_PROC_FS */ 1000#endif /* CONFIG_PROC_FS */
1001 1001
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 87d4202522ee..815190be528c 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -115,11 +115,11 @@ static struct udp_seq_afinfo udplite6_seq_afinfo = {
115 115
116int __init udplite6_proc_init(void) 116int __init udplite6_proc_init(void)
117{ 117{
118 return udp_proc_register(&udplite6_seq_afinfo); 118 return udp_proc_register(&init_net, &udplite6_seq_afinfo);
119} 119}
120 120
121void udplite6_proc_exit(void) 121void udplite6_proc_exit(void)
122{ 122{
123 udp_proc_unregister(&udplite6_seq_afinfo); 123 udp_proc_unregister(&init_net, &udplite6_seq_afinfo);
124} 124}
125#endif 125#endif