diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-10-10 18:45:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:56 -0400 |
commit | ceb1eec8291175686d0208e66595ff83bc0624e2 (patch) | |
tree | 83a7fdc7d292f1dbb80f32563d9573810bfe6e42 /net/ipv4/xfrm4_output.c | |
parent | 87bdc48d304191313203df9b98d783e1ab5a55ab (diff) |
[IPSEC]: Move IP length/checksum setting out of transforms
This patch moves the setting of the IP length and checksum fields out of
the transforms and into the xfrmX_output functions. This would help future
efforts in merging the transforms themselves.
It also adds an optimisation to ipcomp due to the fact that the transport
offset is guaranteed to be zero.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_output.c')
-rw-r--r-- | net/ipv4/xfrm4_output.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index 04805c7d79c3..434ef302ba83 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c | |||
@@ -44,6 +44,7 @@ static inline int xfrm4_output_one(struct sk_buff *skb) | |||
44 | { | 44 | { |
45 | struct dst_entry *dst = skb->dst; | 45 | struct dst_entry *dst = skb->dst; |
46 | struct xfrm_state *x = dst->xfrm; | 46 | struct xfrm_state *x = dst->xfrm; |
47 | struct iphdr *iph; | ||
47 | int err; | 48 | int err; |
48 | 49 | ||
49 | if (x->props.mode == XFRM_MODE_TUNNEL) { | 50 | if (x->props.mode == XFRM_MODE_TUNNEL) { |
@@ -56,6 +57,10 @@ static inline int xfrm4_output_one(struct sk_buff *skb) | |||
56 | if (err) | 57 | if (err) |
57 | goto error_nolock; | 58 | goto error_nolock; |
58 | 59 | ||
60 | iph = ip_hdr(skb); | ||
61 | iph->tot_len = htons(skb->len); | ||
62 | ip_send_check(iph); | ||
63 | |||
59 | IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED; | 64 | IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED; |
60 | err = 0; | 65 | err = 0; |
61 | 66 | ||