mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
[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:
parent
87bdc48d30
commit
ceb1eec829
14 changed files with 23 additions and 65 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue