Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 215276c0 authored by Steffen Klassert's avatar Steffen Klassert
Browse files

xfrm: Reset encapsulation field of the skb before transformation



The inner headers are invalid after a xfrm transformation.
So reset the skb encapsulation field to ensure nobody tries
to access the inner headers.

Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 6ad3122a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -99,6 +99,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)


		skb_dst_force(skb);
		skb_dst_force(skb);


		/* Inner headers are invalid now. */
		skb->encapsulation = 0;

		err = x->type->output(x, skb);
		err = x->type->output(x, skb);
		if (err == -EINPROGRESS)
		if (err == -EINPROGRESS)
			goto out;
			goto out;