summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--process.cpp5
-rw-r--r--test/process_unittest.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/process.cpp b/process.cpp
index 7e6410d..683bf77 100644
--- a/process.cpp
+++ b/process.cpp
@@ -136,9 +136,8 @@ ipmi_ret_t processBlobCommand(IpmiBlobHandler cmd, ManagerInterface* mgr,
/* The command, whatever it was, replied, so let's set the CRC. */
crc->clear();
- replyCmdBuf[0] = 0x00;
- replyCmdBuf[1] = 0x00;
- crc->compute(replyCmdBuf, replyLength);
+ crc->compute(replyCmdBuf + sizeof(uint16_t),
+ replyLength - sizeof(uint16_t));
/* Copy the CRC into place. */
uint16_t crcValue = crc->get();
diff --git a/test/process_unittest.cpp b/test/process_unittest.cpp
index 4f8c9a6..a908ee6 100644
--- a/test/process_unittest.cpp
+++ b/test/process_unittest.cpp
@@ -294,7 +294,7 @@ TEST(ProcessBlobCommandTest, CommandReturnsOkWithValidPayloadLength)
dataLen = sizeof(request);
EXPECT_CALL(crc, clear());
- EXPECT_CALL(crc, compute(_, payloadLen));
+ EXPECT_CALL(crc, compute(_, payloadLen - sizeof(uint16_t)));
EXPECT_CALL(crc, get()).WillOnce(Return(0x3412));
EXPECT_EQ(IPMI_CC_OK,
OpenPOWER on IntegriCloud