diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-10-08 20:25:53 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:54 -0400 |
commit | 436a0a402203d5a47d2edf7e4dde6c08a7257983 (patch) | |
tree | b47e73326a2ff7dbf8ac3fbcb6c4acea5c06619d /include/net/xfrm.h | |
parent | 83815dea47cf3e98ccbb6aecda08cba1ba91208f (diff) |
[IPSEC]: Move output replay code into xfrm_output
The replay counter is one of only two remaining things in the output code
that requires a lock on the xfrm state (the other being the crypto). This
patch moves it into the generic xfrm_output so we can remove the lock from
the transforms themselves.
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 | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bb9193434eb3..a267725f9753 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _NET_XFRM_H | 2 | #define _NET_XFRM_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/in.h> | ||
6 | #include <linux/xfrm.h> | 5 | #include <linux/xfrm.h> |
7 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
8 | #include <linux/list.h> | 7 | #include <linux/list.h> |
@@ -16,6 +15,7 @@ | |||
16 | 15 | ||
17 | #include <net/sock.h> | 16 | #include <net/sock.h> |
18 | #include <net/dst.h> | 17 | #include <net/dst.h> |
18 | #include <net/ip.h> | ||
19 | #include <net/route.h> | 19 | #include <net/route.h> |
20 | #include <net/ipv6.h> | 20 | #include <net/ipv6.h> |
21 | #include <net/ip6_fib.h> | 21 | #include <net/ip6_fib.h> |
@@ -279,6 +279,7 @@ struct xfrm_type | |||
279 | __u8 proto; | 279 | __u8 proto; |
280 | __u8 flags; | 280 | __u8 flags; |
281 | #define XFRM_TYPE_NON_FRAGMENT 1 | 281 | #define XFRM_TYPE_NON_FRAGMENT 1 |
282 | #define XFRM_TYPE_REPLAY_PROT 2 | ||
282 | 283 | ||
283 | int (*init_state)(struct xfrm_state *x); | 284 | int (*init_state)(struct xfrm_state *x); |
284 | void (*destructor)(struct xfrm_state *); | 285 | void (*destructor)(struct xfrm_state *); |
@@ -419,6 +420,23 @@ extern int xfrm_unregister_km(struct xfrm_mgr *km); | |||
419 | 420 | ||
420 | extern unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; | 421 | extern unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; |
421 | 422 | ||
423 | /* | ||
424 | * This structure is used for the duration where packets are being | ||
425 | * transformed by IPsec. As soon as the packet leaves IPsec the | ||
426 | * area beyond the generic IP part may be overwritten. | ||
427 | */ | ||
428 | struct xfrm_skb_cb { | ||
429 | union { | ||
430 | struct inet_skb_parm h4; | ||
431 | struct inet6_skb_parm h6; | ||
432 | } header; | ||
433 | |||
434 | /* Sequence number for replay protection. */ | ||
435 | u64 seq; | ||
436 | }; | ||
437 | |||
438 | #define XFRM_SKB_CB(__skb) ((struct xfrm_skb_cb *)&((__skb)->cb[0])) | ||
439 | |||
422 | /* Audit Information */ | 440 | /* Audit Information */ |
423 | struct xfrm_audit | 441 | struct xfrm_audit |
424 | { | 442 | { |