]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: skip invalid partial checksums
authorDoug Berger <opendmb@gmail.com>
Thu, 17 Mar 2022 01:28:12 +0000 (18:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Mar 2022 16:34:24 +0000 (09:34 -0700)
commit73f8b9c9c324a087e1c3ffb538caad166cd60d3b
treef4c610cf9c0e6d301d6893e26082a11550e64b27
parentc08c8fd73773462fbeea6c3b30e06975a270635c
net: bcmgenet: skip invalid partial checksums

The RXCHK block will return a partial checksum of 0 if it encounters
a problem while receiving a packet. Since a 1's complement sum can
only produce this result if no bits are set in the received data
stream it is fair to treat it as an invalid partial checksum and
not pass it up the stack.

Fixes: 27aaaa638a5b ("net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220317012812.1313196-1-opendmb@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c