]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: selftests: fix TCP packet checksum
authorJakub Kicinski <kuba@kernel.org>
Tue, 24 Jun 2025 18:32:58 +0000 (11:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:58:00 +0000 (10:58 +0200)
commitcd17ecf77c6f49613d7f8d8e4496ec711aa53bd3
tree7622cc46cc69f50404d6d86bed9b1c90f902a816
parent21717504a6aaca7257a914b729d90c1317c84a4b
net: selftests: fix TCP packet checksum

[ Upstream commit 8d89661a36dd3bb8c9902cff36dc0c144dce3faf ]

The length in the pseudo header should be the length of the L3 payload
AKA the L4 header+payload. The selftest code builds the packet from
the lower layers up, so all the headers are pushed already when it
constructs L4. We need to subtract the lower layer headers from skb->len.

Fixes: 3e1e58d64c3d ("net: add generic selftest support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250624183258.3377740-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/selftests.c