Skip to content
Commit 17175d1a authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by Steffen Klassert
Browse files

xfrm: esp6: fix encapsulation header offset computation



In commit 0146dca7, I incorrectly adapted the code that computes
the location of the UDP or TCP encapsulation header from IPv4 to
IPv6. In esp6_input_done2, skb->transport_header points to the ESP
header, so by adding skb_network_header_len, uh and th will point to
the ESP header, not the encapsulation header that's in front of it.

Since the TCP header's size can change with options, we have to start
from the IPv6 header and walk past possible extensions.

Fixes: 0146dca7 ("xfrm: add support for UDPv6 encapsulation of ESP")
Fixes: 26333c37 ("xfrm: add IPv6 support for espintcp")
Reported-by: default avatarTobias Brunner <tobias@strongswan.org>
Tested-by: default avatarTobias Brunner <tobias@strongswan.org>
Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 4f47e8ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment