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 /net/xfrm/xfrm_policy.c | |
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 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 38822b34ba7d..393cc65dbfa4 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -34,8 +34,6 @@ | |||
34 | 34 | ||
35 | #include "xfrm_hash.h" | 35 | #include "xfrm_hash.h" |
36 | 36 | ||
37 | int sysctl_xfrm_larval_drop __read_mostly = 1; | ||
38 | |||
39 | DEFINE_MUTEX(xfrm_cfg_mutex); | 37 | DEFINE_MUTEX(xfrm_cfg_mutex); |
40 | EXPORT_SYMBOL(xfrm_cfg_mutex); | 38 | EXPORT_SYMBOL(xfrm_cfg_mutex); |
41 | 39 | ||
@@ -1671,7 +1669,7 @@ restart: | |||
1671 | 1669 | ||
1672 | if (unlikely(nx<0)) { | 1670 | if (unlikely(nx<0)) { |
1673 | err = nx; | 1671 | err = nx; |
1674 | if (err == -EAGAIN && sysctl_xfrm_larval_drop) { | 1672 | if (err == -EAGAIN && net->xfrm.sysctl_larval_drop) { |
1675 | /* EREMOTE tells the caller to generate | 1673 | /* EREMOTE tells the caller to generate |
1676 | * a one-shot blackhole route. | 1674 | * a one-shot blackhole route. |
1677 | */ | 1675 | */ |
@@ -2504,8 +2502,13 @@ static int __net_init xfrm_net_init(struct net *net) | |||
2504 | rv = xfrm_policy_init(net); | 2502 | rv = xfrm_policy_init(net); |
2505 | if (rv < 0) | 2503 | if (rv < 0) |
2506 | goto out_policy; | 2504 | goto out_policy; |
2505 | rv = xfrm_sysctl_init(net); | ||
2506 | if (rv < 0) | ||
2507 | goto out_sysctl; | ||
2507 | return 0; | 2508 | return 0; |
2508 | 2509 | ||
2510 | out_sysctl: | ||
2511 | xfrm_policy_fini(net); | ||
2509 | out_policy: | 2512 | out_policy: |
2510 | xfrm_state_fini(net); | 2513 | xfrm_state_fini(net); |
2511 | out_state: | 2514 | out_state: |
@@ -2516,6 +2519,7 @@ out_statistics: | |||
2516 | 2519 | ||
2517 | static void __net_exit xfrm_net_exit(struct net *net) | 2520 | static void __net_exit xfrm_net_exit(struct net *net) |
2518 | { | 2521 | { |
2522 | xfrm_sysctl_fini(net); | ||
2519 | xfrm_policy_fini(net); | 2523 | xfrm_policy_fini(net); |
2520 | xfrm_state_fini(net); | 2524 | xfrm_state_fini(net); |
2521 | xfrm_statistics_fini(net); | 2525 | xfrm_statistics_fini(net); |