summaryrefslogtreecommitdiffstats
path: root/ipmid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ipmid.cpp')
-rw-r--r--ipmid.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/ipmid.cpp b/ipmid.cpp
index f06adc5..a05992b 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -380,10 +380,11 @@ static int handle_ipmi_command(sd_bus_message *m, void *user_data, sd_bus_error
if(r != 0)
{
fprintf(stderr,"ERROR:[0x%X] handling NetFn:[0x%X], Cmd:[0x%X]\n",r, netfn, cmd);
-
- if(r < 0) {
- response[0] = IPMI_CC_UNSPECIFIED_ERROR;
- }
+ resplen = 0;
+ }
+ else
+ {
+ resplen = resplen - 1; // first byte is for return code.
}
fprintf(ipmiio, "IPMI Response:\n");
@@ -391,7 +392,7 @@ static int handle_ipmi_command(sd_bus_message *m, void *user_data, sd_bus_error
// Send the response buffer from the ipmi command
r = send_ipmi_message(m, sequence, netfn, lun, cmd, response[0],
- ((unsigned char *)response) + 1, resplen - 1);
+ ((unsigned char *)response) + 1, resplen);
if (r < 0) {
fprintf(stderr, "Failed to send the response message\n");
return -1;
OpenPOWER on IntegriCloud