xfrm: Fix eth_hdr(skb)->h_proto to reflect inner IP version
authorYossi Kuperman <yossiku@mellanox.com>
Mon, 22 Jan 2018 22:16:21 +0000 (00:16 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 23 Jan 2018 09:56:36 +0000 (10:56 +0100)
commit5efec5c655dd31944af440ff2b0a93facc4a7762
tree577ea2660c599eab1175b2e743ee147623c727b5
parentaa5dd6fa6f5d4bdc82a67e952bba8ad2e98d77e2
xfrm: Fix eth_hdr(skb)->h_proto to reflect inner IP version

IPSec tunnel mode supports encapsulation of IPv4 over IPv6 and vice-versa.

The outer IP header is stripped and the inner IP inherits the original
Ethernet header. Tcpdump fails to properly decode the inner packet in
case that h_proto is different than the inner IP version.

Fix h_proto to reflect the inner IP version.

Signed-off-by: Yossi Kuperman <yossiku@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/xfrm6_mode_tunnel.c