diff options
author | Terry S. Duncan <terry.s.duncan@linux.intel.com> | 2019-08-20 02:24:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-20 21:42:40 +0200 |
commit | 96a1b033ac24ccc58156f05c183b2cba0b9412d5 (patch) | |
tree | cc39554e98289aeaf1b034067bcf0924d29dd9a5 /net/ncsi/ncsi-cmd.c | |
parent | net/smc: make sure EPOLLOUT is raised (diff) | |
download | linux-96a1b033ac24ccc58156f05c183b2cba0b9412d5.tar.xz linux-96a1b033ac24ccc58156f05c183b2cba0b9412d5.zip |
net/ncsi: Ensure 32-bit boundary for data cksum
The NCSI spec indicates that if the data does not end on a 32 bit
boundary, one to three padding bytes equal to 0x00 shall be present to
align the checksum field to a 32-bit boundary.
Signed-off-by: Terry S. Duncan <terry.s.duncan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi/ncsi-cmd.c')
-rw-r--r-- | net/ncsi/ncsi-cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c index 5c3fad8cba57..eab4346b0a39 100644 --- a/net/ncsi/ncsi-cmd.c +++ b/net/ncsi/ncsi-cmd.c @@ -54,7 +54,7 @@ static void ncsi_cmd_build_header(struct ncsi_pkt_hdr *h, checksum = ncsi_calculate_checksum((unsigned char *)h, sizeof(*h) + nca->payload); pchecksum = (__be32 *)((void *)h + sizeof(struct ncsi_pkt_hdr) + - nca->payload); + ALIGN(nca->payload, 4)); *pchecksum = htonl(checksum); } |