From 5dbb6b69ded6e9b03a5a54c7f1869c0d010264cd Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Thu, 20 Dec 2012 08:53:05 +0000 Subject: [PATCH] ID: 3577154 - 'lib/ipmi_mc.c' - return value of 'mc reset' Commit adds response handling for 'mc reset' commands according to IPMI specification. Reported by: Duncan Idaho --- ipmitool/lib/ipmi_mc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ipmitool/lib/ipmi_mc.c b/ipmitool/lib/ipmi_mc.c index baa6534..070ba8c 100644 --- a/ipmitool/lib/ipmi_mc.c +++ b/ipmitool/lib/ipmi_mc.c @@ -79,6 +79,17 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd) if (cmd == BMC_COLD_RESET) intf->abort = 1; + if (cmd == BMC_COLD_RESET && rsp == NULL) { + /* This is expected. See 20.2 Cold Reset Command, p.243, IPMIv2.0 rev1.0 */ + } else if (rsp == NULL) { + lprintf(LOG_ERR, "MC reset command failed."); + return (-1); + } else if (rsp->ccode > 0) { + lprintf(LOG_ERR, "MC reset command failed: %s", + val2str(rsp->ccode, completion_code_vals)); + return (-1); + } + printf("Sent %s reset command to MC\n", (cmd == BMC_WARM_RESET) ? "warm" : "cold");