diff options
author | Karsten Graul <kgraul@linux.vnet.ibm.com> | 2018-02-28 12:44:07 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-28 18:30:25 +0100 |
commit | cbba07a726fb6b52b48d24ffd27e36f7278864e0 (patch) | |
tree | 8bdf681a8a44dfcd5936d83c6d03c9eeb49b4064 /net/smc/smc_cdc.c | |
parent | virtio-net: disable NAPI only when enabled during XDP set (diff) | |
download | linux-cbba07a726fb6b52b48d24ffd27e36f7278864e0.tar.xz linux-cbba07a726fb6b52b48d24ffd27e36f7278864e0.zip |
net/smc: use a constant for control message length
The sizeof(struct smc_cdc_msg) evaluates to 48 bytes instead of the
required 44 bytes. We need to use the constant value of
SMC_WR_TX_SIZE to set and check the control message length.
Signed-off-by: Karsten Graul <kgraul@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_cdc.c')
-rw-r--r-- | net/smc/smc_cdc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c index 3cd086e5bd28..b42395d24cba 100644 --- a/net/smc/smc_cdc.c +++ b/net/smc/smc_cdc.c @@ -269,7 +269,7 @@ static void smc_cdc_rx_handler(struct ib_wc *wc, void *buf) if (wc->byte_len < offsetof(struct smc_cdc_msg, reserved)) return; /* short message */ - if (cdc->len != sizeof(*cdc)) + if (cdc->len != SMC_WR_TX_SIZE) return; /* invalid message */ smc_cdc_msg_recv(cdc, link, wc->wr_id); } |