Use more specific ipmi error codes
Most errors in the handler were returning an unsupported code and not a
more specific code articulating the failure. Update the code to use
more specific errors.
Change-Id: I7f517d094245e8e1a6169f43582522889bb895d0
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/eth.cpp b/eth.cpp
index 2689fab..6dbf077 100644
--- a/eth.cpp
+++ b/eth.cpp
@@ -73,20 +73,20 @@
{
std::fprintf(stderr, "Invalid command length: %u\n",
static_cast<uint32_t>(*dataLen));
- return IPMI_CC_INVALID;
+ return IPMI_CC_REQ_DATA_LEN_INVALID;
}
std::string device = NCSI_IF_NAME_STR;
if (device.length() == 0)
{
std::fprintf(stderr, "Invalid eth string\n");
- return IPMI_CC_INVALID;
+ return IPMI_CC_REQ_DATA_LEN_INVALID;
}
if ((sizeof(struct EthDeviceReply) + device.length()) > MAX_IPMI_BUFFER)
{
std::fprintf(stderr, "Response would overflow response buffer\n");
- return IPMI_CC_INVALID;
+ return IPMI_CC_REQUESTED_TOO_MANY_BYTES;
}
// Fill in the response buffer.