diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2016-02-22 10:56:45 +0100 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2016-03-17 10:28:44 +0100 |
commit | 215276c0147ef49bc07692ca68bae35a30a64b9a (patch) | |
tree | 9076597df2a33a6bbd324953429c20819fd5d591 /net/xfrm/xfrm_output.c | |
parent | 6ad3122a08e3a9c2148873665752e87cf4f393cc (diff) | |
download | linux-215276c0147ef49bc07692ca68bae35a30a64b9a.tar.bz2 |
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.c | 3 |
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; |