summaryrefslogtreecommitdiffstats
path: root/process.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-01-10 13:12:20 -0800
committerPatrick Venture <venture@google.com>2019-01-14 17:02:48 +0000
commitd1c3e86f2368ec69098a4e786a5c4e9d2455ae1d (patch)
treebc8d15ec7233090f803d7be76bbd94b87a57e731 /process.cpp
parent2f58151ea0f49929eb7d1ebaa42b429883677670 (diff)
downloadphosphor-ipmi-blobs-d1c3e86f2368ec69098a4e786a5c4e9d2455ae1d.tar.gz
phosphor-ipmi-blobs-d1c3e86f2368ec69098a4e786a5c4e9d2455ae1d.zip
bugfix: process: can be only crc
The read command, if returning 0 bytes of data, does return the CRC. Tested: Verified via a client implementation that it now behaves as expected on returning 0 bytes from a read (returns only the CRC). Change-Id: I84200c0fbe8400cc9234b55991fee750cb84faa2 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'process.cpp')
-rw-r--r--process.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/process.cpp b/process.cpp
index 683bf77..a73f70e 100644
--- a/process.cpp
+++ b/process.cpp
@@ -128,8 +128,10 @@ ipmi_ret_t processBlobCommand(IpmiBlobHandler cmd, ManagerInterface* mgr,
return result;
}
- /* The response, if it has one byte, has three, to include the crc16. */
- if (replyLength < (sizeof(uint16_t) + 1))
+ /* Read can return 0 bytes, and just a CRC, otherwise you need a CRC and 1
+ * byte, therefore the limit is 2 bytes.
+ */
+ if (replyLength < (sizeof(uint16_t)))
{
return IPMI_CC_UNSPECIFIED_ERROR;
}
OpenPOWER on IntegriCloud