]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: fix tunnel mode TX datapath in packet offload mode
authorAlexandre Cassen <acassen@corp.free.fr>
Wed, 19 Feb 2025 10:20:37 +0000 (12:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:25 +0000 (22:03 +0100)
commita0395e96831adee8ffa016bf958e4dce9ece656e
tree433900e55ff36c0f5a0aa5461b095902134c3184
parenta64df69c9718d95487d0db393fdbc98a4fe3be82
xfrm: fix tunnel mode TX datapath in packet offload mode

[ Upstream commit 5eddd76ec2fd1988f0a3450fde9730b10dd22992 ]

Packets that match the output xfrm policy are delivered to the netstack.
In IPsec packet mode for tunnel mode, the HW is responsible for building
the hard header and outer IP header. In such a situation, the inner
header may refer to a network that is not directly reachable by the host,
resulting in a failed neighbor resolution. The packet is then dropped.
xfrm policy defines the netdevice to use for xmit so we can send packets
directly to it.

Makes direct xmit exclusive to tunnel mode, since some rules may apply
in transport mode.

Fixes: f8a70afafc17 ("xfrm: add TX datapath support for IPsec packet offload mode")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_output.c