]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Wed, 19 Aug 2020 01:53:58 +0000 (13:53 +1200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 16 Sep 2020 09:15:01 +0000 (05:15 -0400)
commit44fb8252f2cbcd4a585af92d34ff2e86b877e246
tree52183eca38ee97d3bab1445a9b09ea155c9a9bd4
parent103163f274ac8253cd4ce82ed2765be29d20ebd5
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY

BugLink: https://bugs.launchpad.net/bugs/1895174
[ Upstream commit 272502fcb7cda01ab07fc2fcff82d1d2f73d43cc ]

When receiving an IPv4 packet inside an IPv6 GRE packet, and the
IP6_TNL_F_RCV_DSCP_COPY flag is set on the tunnel, the IPv4 header would
get corrupted. This is due to the common ip6_tnl_rcv() function assuming
that the inner header is always IPv6. This patch checks the tunnel
protocol for IPv4 inner packets, but still defaults to IPv6.

Fixes: 308edfdf1563 ("gre6: Cleanup GREv6 receive path, call common GRE functions")
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv6/ip6_tunnel.c