summaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2016-02-22 12:56:45 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2016-03-17 12:28:44 +0300
commit215276c0147ef49bc07692ca68bae35a30a64b9a (patch)
tree9076597df2a33a6bbd324953429c20819fd5d591 /net/xfrm/xfrm_output.c
parent6ad3122a08e3a9c2148873665752e87cf4f393cc (diff)
downloadlinux-215276c0147ef49bc07692ca68bae35a30a64b9a.tar.xz
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: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index ff4a91fcab9f..637387bbaaea 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -99,6 +99,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
skb_dst_force(skb);
+ /* Inner headers are invalid now. */
+ skb->encapsulation = 0;
+
err = x->type->output(x, skb);
if (err == -EINPROGRESS)
goto out;