mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[IPCOMP]: Fix truesize after decompression
The truesize check has uncovered the fact that we forgot to update truesize after pskb_expand_head. Unfortunately pskb_expand_head can't update it for us because it's used in all sorts of different contexts, some of which would not allow truesize to be updated by itself. So the solution for now is to simply update it in IPComp. This patch also changes skb_put to __skb_put since we've just expanded tailroom by exactly that amount so we know it's there (but gcc does not). 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
8a6ce0c083
commit
da952315c9
2 changed files with 4 additions and 2 deletions
|
@ -70,7 +70,8 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
skb_put(skb, dlen - plen);
|
skb->truesize += dlen - plen;
|
||||||
|
__skb_put(skb, dlen - plen);
|
||||||
memcpy(skb->data, scratch, dlen);
|
memcpy(skb->data, scratch, dlen);
|
||||||
out:
|
out:
|
||||||
put_cpu();
|
put_cpu();
|
||||||
|
|
|
@ -109,7 +109,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
goto out_put_cpu;
|
goto out_put_cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_put(skb, dlen - plen);
|
skb->truesize += dlen - plen;
|
||||||
|
__skb_put(skb, dlen - plen);
|
||||||
memcpy(skb->data, scratch, dlen);
|
memcpy(skb->data, scratch, dlen);
|
||||||
err = ipch->nexthdr;
|
err = ipch->nexthdr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue