diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-10-09 16:29:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:01 -0400 |
commit | 658b219e9379d75fbdc578b9630b598098471258 (patch) | |
tree | fe802c4e1ee6468a9c2558a5e529b2380845a003 /include/net/xfrm.h | |
parent | 75ba28c633952f7994a7117c98ae6515b58f8d30 (diff) |
[IPSEC]: Move common code into xfrm_alloc_spi
This patch moves some common code that conceptually belongs to the xfrm core
from af_key/xfrm_user into xfrm_alloc_spi.
In particular, the spin lock on the state is now taken inside xfrm_alloc_spi.
Previously it also protected the construction of the response PF_KEY/XFRM
messages to user-space. This is inconsistent as other identical constructions
are not protected by the state lock. This is bad because they in fact should
be protected but only in certain spots (so as not to hold the lock for too
long which may cause packet drops).
The SPI byte order conversion has also been moved.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 064a4ca63476..1c116dc03e0e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1084,7 +1084,7 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | |||
1084 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); | 1084 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); |
1085 | int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); | 1085 | int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); |
1086 | u32 xfrm_get_acqseq(void); | 1086 | u32 xfrm_get_acqseq(void); |
1087 | void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); | 1087 | extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
1088 | struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, | 1088 | struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, |
1089 | xfrm_address_t *daddr, xfrm_address_t *saddr, | 1089 | xfrm_address_t *daddr, xfrm_address_t *saddr, |
1090 | int create, unsigned short family); | 1090 | int create, unsigned short family); |