aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-12-05 04:41:26 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:27 -0500
commit3e37c3f9978839d91188e4ca0cc662a7245f28e4 (patch)
tree56574ce30de6f52e2d476b1a3a9993a380edcec6
parent9ba639797606acbcd97be886f41fbce163914e7b (diff)
[IPV4]: Use ctl paths to register net/ipv4/ table
This is the same as I did for the net/core/ table in the second patch in his series: use the paths and isolate the whole table in the .c file. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip.h2
-rw-r--r--net/ipv4/sysctl_net_ipv4.c19
-rw-r--r--net/sysctl_net.c8
3 files changed, 18 insertions, 11 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 66d51616ade8..17d1189723fc 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -395,6 +395,4 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
395extern int ip_misc_proc_init(void); 395extern int ip_misc_proc_init(void);
396#endif 396#endif
397 397
398extern struct ctl_table ipv4_table[];
399
400#endif /* _IP_H */ 398#endif /* _IP_H */
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 3546424765f5..bfd0dec6238d 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -13,6 +13,7 @@
13#include <linux/igmp.h> 13#include <linux/igmp.h>
14#include <linux/inetdevice.h> 14#include <linux/inetdevice.h>
15#include <linux/seqlock.h> 15#include <linux/seqlock.h>
16#include <linux/init.h>
16#include <net/snmp.h> 17#include <net/snmp.h>
17#include <net/icmp.h> 18#include <net/icmp.h>
18#include <net/ip.h> 19#include <net/ip.h>
@@ -247,7 +248,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam
247 248
248} 249}
249 250
250ctl_table ipv4_table[] = { 251static struct ctl_table ipv4_table[] = {
251 { 252 {
252 .ctl_name = NET_IPV4_TCP_TIMESTAMPS, 253 .ctl_name = NET_IPV4_TCP_TIMESTAMPS,
253 .procname = "tcp_timestamps", 254 .procname = "tcp_timestamps",
@@ -878,3 +879,19 @@ ctl_table ipv4_table[] = {
878 }, 879 },
879 { .ctl_name = 0 } 880 { .ctl_name = 0 }
880}; 881};
882
883static __initdata struct ctl_path net_ipv4_path[] = {
884 { .procname = "net", .ctl_name = CTL_NET, },
885 { .procname = "ipv4", .ctl_name = NET_IPV4, },
886 { },
887};
888
889static __init int sysctl_ipv4_init(void)
890{
891 struct ctl_table_header *hdr;
892
893 hdr = register_sysctl_paths(net_ipv4_path, ipv4_table);
894 return hdr == NULL ? -ENOMEM : 0;
895}
896
897__initcall(sysctl_ipv4_init);
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 747fc55b28f1..a4f0ed8d0e79 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -31,14 +31,6 @@
31#endif 31#endif
32 32
33struct ctl_table net_table[] = { 33struct ctl_table net_table[] = {
34#ifdef CONFIG_INET
35 {
36 .ctl_name = NET_IPV4,
37 .procname = "ipv4",
38 .mode = 0555,
39 .child = ipv4_table
40 },
41#endif
42#ifdef CONFIG_TR 34#ifdef CONFIG_TR
43 { 35 {
44 .ctl_name = NET_TR, 36 .ctl_name = NET_TR,