]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv4: raw: Fix sending packets from raw sockets via IPsec tunnels
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Mar 2024 14:35:40 +0000 (15:35 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:11 +0000 (18:20 -0400)
commita4cbcc4c4546480d69574fdff6a70842a43c2903
tree07eabe7d8654b97abcbcac866ef9b358d7c2e043
parent0f25725d62d9a82a6ada342cc1d06c620b201ec9
ipv4: raw: Fix sending packets from raw sockets via IPsec tunnels

[ Upstream commit c9b3b81716c5b92132a6c1d4ac3c48a7b44082ab ]

Since the referenced commit, the xfrm_inner_extract_output() function
uses the protocol field to determine the address family.  So not setting
it for IPv4 raw sockets meant that such packets couldn't be tunneled via
IPsec anymore.

IPv6 raw sockets are not affected as they already set the protocol since
9c9c9ad5fae7 ("ipv6: set skb->protocol on tcp, raw and ip6_append_data
genereated skbs").

Fixes: f4796398f21b ("xfrm: Remove inner/outer modes from output path")
Signed-off-by: Tobias Brunner <tobias@strongswan.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/c5d9a947-eb19-4164-ac99-468ea814ce20@strongswan.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/raw.c