aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2016-02-22 04:56:45 -0500
committerSteffen Klassert <steffen.klassert@secunet.com>2016-03-17 05:28:44 -0400
commit215276c0147ef49bc07692ca68bae35a30a64b9a (patch)
tree9076597df2a33a6bbd324953429c20819fd5d591 /net/xfrm
parent6ad3122a08e3a9c2148873665752e87cf4f393cc (diff)
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')
-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)
99 99
100 skb_dst_force(skb); 100 skb_dst_force(skb);
101 101
102 /* Inner headers are invalid now. */
103 skb->encapsulation = 0;
104
102 err = x->type->output(x, skb); 105 err = x->type->output(x, skb);
103 if (err == -EINPROGRESS) 106 if (err == -EINPROGRESS)
104 goto out; 107 goto out;