[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>
This commit is contained in:
Herbert Xu 2007-10-10 15:45:52 -07:00 committed by David S. Miller
parent 87bdc48d30
commit ceb1eec829
14 changed files with 23 additions and 65 deletions

View file

@ -47,6 +47,7 @@ static inline int xfrm6_output_one(struct sk_buff *skb)
{
struct dst_entry *dst = skb->dst;
struct xfrm_state *x = dst->xfrm;
struct ipv6hdr *iph;
int err;
if (x->props.mode == XFRM_MODE_TUNNEL) {
@ -59,6 +60,9 @@ static inline int xfrm6_output_one(struct sk_buff *skb)
if (err)
goto error_nolock;
iph = ipv6_hdr(skb);
iph->payload_len = htons(skb->len - sizeof(*iph));
IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED;
err = 0;