Commit 3e37c3f9 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ba63979
...@@ -395,6 +395,4 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, ...@@ -395,6 +395,4 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
extern int ip_misc_proc_init(void); extern int ip_misc_proc_init(void);
#endif #endif
extern struct ctl_table ipv4_table[];
#endif /* _IP_H */ #endif /* _IP_H */
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/igmp.h> #include <linux/igmp.h>
#include <linux/inetdevice.h> #include <linux/inetdevice.h>
#include <linux/seqlock.h> #include <linux/seqlock.h>
#include <linux/init.h>
#include <net/snmp.h> #include <net/snmp.h>
#include <net/icmp.h> #include <net/icmp.h>
#include <net/ip.h> #include <net/ip.h>
...@@ -247,7 +248,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam ...@@ -247,7 +248,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam
} }
ctl_table ipv4_table[] = { static struct ctl_table ipv4_table[] = {
{ {
.ctl_name = NET_IPV4_TCP_TIMESTAMPS, .ctl_name = NET_IPV4_TCP_TIMESTAMPS,
.procname = "tcp_timestamps", .procname = "tcp_timestamps",
...@@ -878,3 +879,19 @@ ctl_table ipv4_table[] = { ...@@ -878,3 +879,19 @@ ctl_table ipv4_table[] = {
}, },
{ .ctl_name = 0 } { .ctl_name = 0 }
}; };
static __initdata struct ctl_path net_ipv4_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ },
};
static __init int sysctl_ipv4_init(void)
{
struct ctl_table_header *hdr;
hdr = register_sysctl_paths(net_ipv4_path, ipv4_table);
return hdr == NULL ? -ENOMEM : 0;
}
__initcall(sysctl_ipv4_init);
...@@ -31,14 +31,6 @@ ...@@ -31,14 +31,6 @@
#endif #endif
struct ctl_table net_table[] = { struct ctl_table net_table[] = {
#ifdef CONFIG_INET
{
.ctl_name = NET_IPV4,
.procname = "ipv4",
.mode = 0555,
.child = ipv4_table
},
#endif
#ifdef CONFIG_TR #ifdef CONFIG_TR
{ {
.ctl_name = NET_TR, .ctl_name = NET_TR,
......
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