diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-25 21:00:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 21:00:48 -0500 |
commit | b27aeadb5948d400df83db4d29590fb9862ba49d (patch) | |
tree | f76cc43150164facbb890e4d5c619a99fe6ce303 /include | |
parent | c68cd1a01ba56995d85a4a62b195b2b3f6415c64 (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 'include')
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | include/net/netns/xfrm.h | 10 | ||||
-rw-r--r-- | include/net/xfrm.h | 14 |
3 files changed, 20 insertions, 5 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index ddef10c22e3a..10868139e656 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -187,6 +187,7 @@ extern void inet_get_local_port_range(int *low, int *high); | |||
187 | extern int sysctl_ip_default_ttl; | 187 | extern int sysctl_ip_default_ttl; |
188 | extern int sysctl_ip_nonlocal_bind; | 188 | extern int sysctl_ip_nonlocal_bind; |
189 | 189 | ||
190 | extern struct ctl_path net_core_path[]; | ||
190 | extern struct ctl_path net_ipv4_ctl_path[]; | 191 | extern struct ctl_path net_ipv4_ctl_path[]; |
191 | 192 | ||
192 | /* From inetpeer.c */ | 193 | /* From inetpeer.c */ |
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 09f3060e9d18..1ba912749caa 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
7 | #include <linux/xfrm.h> | 7 | #include <linux/xfrm.h> |
8 | 8 | ||
9 | struct ctl_table_header; | ||
10 | |||
9 | struct xfrm_policy_hash { | 11 | struct xfrm_policy_hash { |
10 | struct hlist_head *table; | 12 | struct hlist_head *table; |
11 | unsigned int hmask; | 13 | unsigned int hmask; |
@@ -41,6 +43,14 @@ struct netns_xfrm { | |||
41 | struct work_struct policy_hash_work; | 43 | struct work_struct policy_hash_work; |
42 | 44 | ||
43 | struct sock *nlsk; | 45 | struct sock *nlsk; |
46 | |||
47 | u32 sysctl_aevent_etime; | ||
48 | u32 sysctl_aevent_rseqth; | ||
49 | int sysctl_larval_drop; | ||
50 | u32 sysctl_acq_expires; | ||
51 | #ifdef CONFIG_SYSCTL | ||
52 | struct ctl_table_header *sysctl_hdr; | ||
53 | #endif | ||
44 | }; | 54 | }; |
45 | 55 | ||
46 | #endif | 56 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 1554ccd0c940..2e9f5c0018ae 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -47,11 +47,6 @@ | |||
47 | #define XFRM_INC_STATS_USER(net, field) ((void)(net)) | 47 | #define XFRM_INC_STATS_USER(net, field) ((void)(net)) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | extern u32 sysctl_xfrm_aevent_etime; | ||
51 | extern u32 sysctl_xfrm_aevent_rseqth; | ||
52 | extern int sysctl_xfrm_larval_drop; | ||
53 | extern u32 sysctl_xfrm_acq_expires; | ||
54 | |||
55 | extern struct mutex xfrm_cfg_mutex; | 50 | extern struct mutex xfrm_cfg_mutex; |
56 | 51 | ||
57 | /* Organization of SPD aka "XFRM rules" | 52 | /* Organization of SPD aka "XFRM rules" |
@@ -1310,6 +1305,15 @@ extern int xfrm_proc_init(struct net *net); | |||
1310 | extern void xfrm_proc_fini(struct net *net); | 1305 | extern void xfrm_proc_fini(struct net *net); |
1311 | #endif | 1306 | #endif |
1312 | 1307 | ||
1308 | extern int xfrm_sysctl_init(struct net *net); | ||
1309 | #ifdef CONFIG_SYSCTL | ||
1310 | extern void xfrm_sysctl_fini(struct net *net); | ||
1311 | #else | ||
1312 | static inline void xfrm_sysctl_fini(struct net *net) | ||
1313 | { | ||
1314 | } | ||
1315 | #endif | ||
1316 | |||
1313 | extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | 1317 | extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); |
1314 | extern int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, | 1318 | extern int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, |
1315 | int (*func)(struct xfrm_state *, int, void*), void *); | 1319 | int (*func)(struct xfrm_state *, int, void*), void *); |