aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_state.c
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/xfrm/xfrm_state.c
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/xfrm/xfrm_state.c')
-rw-r--r--net/xfrm/xfrm_state.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 662e47b0bcc3..2fd57f8f77c1 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -24,14 +24,6 @@
24 24
25#include "xfrm_hash.h" 25#include "xfrm_hash.h"
26 26
27u32 sysctl_xfrm_aevent_etime __read_mostly = XFRM_AE_ETIME;
28EXPORT_SYMBOL(sysctl_xfrm_aevent_etime);
29
30u32 sysctl_xfrm_aevent_rseqth __read_mostly = XFRM_AE_SEQT_SIZE;
31EXPORT_SYMBOL(sysctl_xfrm_aevent_rseqth);
32
33u32 sysctl_xfrm_acq_expires __read_mostly = 30;
34
35/* Each xfrm_state may be linked to two tables: 27/* Each xfrm_state may be linked to two tables:
36 28
37 1. Hash table by (spi,daddr,ah/esp) to find SA by SPI. (input,ctl) 29 1. Hash table by (spi,daddr,ah/esp) to find SA by SPI. (input,ctl)
@@ -851,8 +843,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
851 h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, family); 843 h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, family);
852 hlist_add_head(&x->byspi, net->xfrm.state_byspi+h); 844 hlist_add_head(&x->byspi, net->xfrm.state_byspi+h);
853 } 845 }
854 x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires; 846 x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
855 x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; 847 x->timer.expires = jiffies + net->xfrm.sysctl_acq_expires*HZ;
856 add_timer(&x->timer); 848 add_timer(&x->timer);
857 net->xfrm.state_num++; 849 net->xfrm.state_num++;
858 xfrm_hash_grow_check(net, x->bydst.next != NULL); 850 xfrm_hash_grow_check(net, x->bydst.next != NULL);
@@ -1040,9 +1032,9 @@ static struct xfrm_state *__find_acq_core(struct net *net, unsigned short family
1040 x->props.family = family; 1032 x->props.family = family;
1041 x->props.mode = mode; 1033 x->props.mode = mode;
1042 x->props.reqid = reqid; 1034 x->props.reqid = reqid;
1043 x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires; 1035 x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
1044 xfrm_state_hold(x); 1036 xfrm_state_hold(x);
1045 x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; 1037 x->timer.expires = jiffies + net->xfrm.sysctl_acq_expires*HZ;
1046 add_timer(&x->timer); 1038 add_timer(&x->timer);
1047 list_add(&x->km.all, &net->xfrm.state_all); 1039 list_add(&x->km.all, &net->xfrm.state_all);
1048 hlist_add_head(&x->bydst, net->xfrm.state_bydst+h); 1040 hlist_add_head(&x->bydst, net->xfrm.state_bydst+h);