diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-07-11 13:50:09 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-07-12 13:58:55 -0700 |
commit | da952315c9c625bd513c6162613fd3fd01d91aae (patch) | |
tree | a57f60a953d0596beb3d230663db34a9b7a02b1a | |
parent | 8a6ce0c083f5736e90dabe6d8ce077e7dd0fa35f (diff) | |
download | op-kernel-dev-da952315c9c625bd513c6162613fd3fd01d91aae.zip op-kernel-dev-da952315c9c625bd513c6162613fd3fd01d91aae.tar.gz |
[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>
-rw-r--r-- | net/ipv4/ipcomp.c | 3 | ||||
-rw-r--r-- | net/ipv6/ipcomp6.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 8e03748..8a8b5cf 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c @@ -70,7 +70,8 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) if (err) goto out; - skb_put(skb, dlen - plen); + skb->truesize += dlen - plen; + __skb_put(skb, dlen - plen); memcpy(skb->data, scratch, dlen); out: put_cpu(); diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index b285b03..7e4d1c1 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c @@ -109,7 +109,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb) goto out_put_cpu; } - skb_put(skb, dlen - plen); + skb->truesize += dlen - plen; + __skb_put(skb, dlen - plen); memcpy(skb->data, scratch, dlen); err = ipch->nexthdr; |