aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-25 21:00:48 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 21:00:48 -0500
commitb27aeadb5948d400df83db4d29590fb9862ba49d (patch)
treef76cc43150164facbb890e4d5c619a99fe6ce303 /net/core
parentc68cd1a01ba56995d85a4a62b195b2b3f6415c64 (diff)
netns xfrm: per-netns sysctls
Make net.core.xfrm_aevent_etime net.core.xfrm_acq_expires net.core.xfrm_aevent_rseqth net.core.xfrm_larval_drop sysctls per-netns. For that make net_core_path[] global, register it to prevent two /proc/net/core antries and change initcall position -- xfrm_init() is called from fs_initcall, so this one should be fs_initcall at least. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sysctl_net_core.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 2bc0384b0448..83d3398559ea 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -12,7 +12,6 @@
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <net/sock.h> 14#include <net/sock.h>
15#include <net/xfrm.h>
16 15
17static struct ctl_table net_core_table[] = { 16static struct ctl_table net_core_table[] = {
18#ifdef CONFIG_NET 17#ifdef CONFIG_NET
@@ -89,40 +88,6 @@ static struct ctl_table net_core_table[] = {
89 .mode = 0644, 88 .mode = 0644,
90 .proc_handler = proc_dointvec 89 .proc_handler = proc_dointvec
91 }, 90 },
92#ifdef CONFIG_XFRM
93 {
94 .ctl_name = NET_CORE_AEVENT_ETIME,
95 .procname = "xfrm_aevent_etime",
96 .data = &sysctl_xfrm_aevent_etime,
97 .maxlen = sizeof(u32),
98 .mode = 0644,
99 .proc_handler = proc_dointvec
100 },
101 {
102 .ctl_name = NET_CORE_AEVENT_RSEQTH,
103 .procname = "xfrm_aevent_rseqth",
104 .data = &sysctl_xfrm_aevent_rseqth,
105 .maxlen = sizeof(u32),
106 .mode = 0644,
107 .proc_handler = proc_dointvec
108 },
109 {
110 .ctl_name = CTL_UNNUMBERED,
111 .procname = "xfrm_larval_drop",
112 .data = &sysctl_xfrm_larval_drop,
113 .maxlen = sizeof(int),
114 .mode = 0644,
115 .proc_handler = proc_dointvec
116 },
117 {
118 .ctl_name = CTL_UNNUMBERED,
119 .procname = "xfrm_acq_expires",
120 .data = &sysctl_xfrm_acq_expires,
121 .maxlen = sizeof(int),
122 .mode = 0644,
123 .proc_handler = proc_dointvec
124 },
125#endif /* CONFIG_XFRM */
126#endif /* CONFIG_NET */ 91#endif /* CONFIG_NET */
127 { 92 {
128 .ctl_name = NET_CORE_BUDGET, 93 .ctl_name = NET_CORE_BUDGET,
@@ -155,7 +120,7 @@ static struct ctl_table netns_core_table[] = {
155 { .ctl_name = 0 } 120 { .ctl_name = 0 }
156}; 121};
157 122
158static __net_initdata struct ctl_path net_core_path[] = { 123__net_initdata struct ctl_path net_core_path[] = {
159 { .procname = "net", .ctl_name = CTL_NET, }, 124 { .procname = "net", .ctl_name = CTL_NET, },
160 { .procname = "core", .ctl_name = NET_CORE, }, 125 { .procname = "core", .ctl_name = NET_CORE, },
161 { }, 126 { },
@@ -207,8 +172,11 @@ static __net_initdata struct pernet_operations sysctl_core_ops = {
207 172
208static __init int sysctl_core_init(void) 173static __init int sysctl_core_init(void)
209{ 174{
175 static struct ctl_table empty[1];
176
177 register_sysctl_paths(net_core_path, empty);
210 register_net_sysctl_rotable(net_core_path, net_core_table); 178 register_net_sysctl_rotable(net_core_path, net_core_table);
211 return register_pernet_subsys(&sysctl_core_ops); 179 return register_pernet_subsys(&sysctl_core_ops);
212} 180}
213 181
214__initcall(sysctl_core_init); 182fs_initcall(sysctl_core_init);