Packets that are not of length divisible by 4 (e.g. 77, 78, 79) would
have the checksum included up to next multiple of 4 (a 77 bytes packet
would have 3 bytes of ethernet checksum included). The check for the
value expects it in host (Little) endian.
Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
Signed-off-by: Casper Andersson <redacted>
---
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 ++
1 file changed, 2 insertions(+)
Hi Casper,
Good Catch.
On Thu, 2022-08-25 at 10:49 +0200, Casper Andersson wrote:
quoted hunk
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Packets that are not of length divisible by 4 (e.g. 77, 78, 79) would
have the checksum included up to next multiple of 4 (a 77 bytes packet
would have 3 bytes of ethernet checksum included). The check for the
value expects it in host (Little) endian.
Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
Signed-off-by: Casper Andersson <redacted>
---
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 ++
1 file changed, 2 insertions(+)
/* This assumes STATUS_WORD_POS == 1, Status
* just after last data
*/
+ if (!byte_swap)
+ val = ntohl((__force __be32)val);
byte_cnt -= (4 - XTR_VALID_BYTES(val));
eof_flag = true;
break;
--
2.34.1
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
--
Best Regards
Steen
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
steen.hegelund@microchip.com
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:
On Thu, 25 Aug 2022 10:49:55 +0200 you wrote:
Packets that are not of length divisible by 4 (e.g. 77, 78, 79) would
have the checksum included up to next multiple of 4 (a 77 bytes packet
would have 3 bytes of ethernet checksum included). The check for the
value expects it in host (Little) endian.
Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
Signed-off-by: Casper Andersson <redacted>
[...]