Commit 417fae2c authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by Steffen Klassert
Browse files

xfrm: ipcomp: fix truesize computation on receive



ipcomp_post_acomp currently drops all frags (via pskb_trim_unique(skb,
0)), and then subtracts the old skb->data_len from truesize. This
adjustment has already be done during trimming (in skb_condense), so
we don't need to do it again.

This shows up for example when running fragmented traffic over ipcomp,
we end up hitting the WARN_ON_ONCE in skb_try_coalesce.

Fixes: eb2953d2 ("xfrm: ipcomp: Use crypto_acomp interface")
Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent e3fd0577
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
{
	struct acomp_req *req = ipcomp_cb(skb)->req;
	struct ipcomp_req_extra *extra;
	const int plen = skb->data_len;
	struct scatterlist *dsg;
	int len, dlen;

@@ -64,7 +63,7 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)

	/* Only update truesize on input. */
	if (!hlen)
		skb->truesize += dlen - plen;
		skb->truesize += dlen;
	skb->data_len = dlen;
	skb->len += dlen;