Re: [PATCH net-next] net/ncsi: support unaligned payload size in NC-SI cmd handler
From: David Miller
Date: Mon Sep 02 2019 - 15:03:04 EST
From: Ben Wei <benwei@xxxxxx>
Date: Mon, 2 Sep 2019 02:46:52 +0000
> Update NC-SI command handler (both standard and OEM) to take into
> account of payload paddings in allocating skb (in case of payload
> size is not 32-bit aligned).
>
> The checksum field follows payload field, without taking payload
> padding into account can cause checksum being truncated, leading to
> dropped packets.
>
> Signed-off-by: Ben Wei <benwei@xxxxxx>
If you have to align and add padding, I do not see where you are
clearing out that padding memory to make sure it is initialized.
You do comparisons with 'payload' but make adjustments to 'len'.
The logic is very confusing.