diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0069-apphandler-Fix-for-get-system-info-command.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0069-apphandler-Fix-for-get-system-info-command.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0069-apphandler-Fix-for-get-system-info-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0069-apphandler-Fix-for-get-system-info-command.patch new file mode 100644 index 000000000..1d6410a6d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0069-apphandler-Fix-for-get-system-info-command.patch @@ -0,0 +1,89 @@ +From a5ae77282bdd60172f7ef1baca117069b8809bb5 Mon Sep 17 00:00:00 2001 +From: Snehalatha V <SnehalathaX.V@intel.com> +Date: Sat, 2 May 2020 18:18:57 +0000 +Subject: [PATCH] apphandler: Fix for get system info command + +Issue: Get system info parameters command giving improper default + results for parameters 1,3,4,5,6,7. + +Fix: Provided fix to return proper default response + +Tested: +Verified using ipmitool raw commands +Command : ipmitool raw 0x06 0x59 0x00 0x01 0x00 0x00 +Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 + cmd=0x59 rsp=0xcb): Requested sensor, data, or record not + found +Command : ipmitool raw 0x06 0x59 0x00 0x02 0x00 0x00 +Response: 11 00 00 0a 69 6e 74 65 6c 2d 6f 62 6d 63 00 00 + 00 00 +Command : ipmitool raw 0x06 0x59 0x00 0x03 0x00 0x00 +Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 + cmd=0x59 rsp=0xcb): Requested sensor, data, or record not + found +Command : ipmitool raw 0x06 0x59 0x00 0x07 0x00 0x00 +Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 + cmd=0x59 rsp=0xcb): Requested sensor, data, or record not + found +Command : ipmitool raw 0x06 0x59 0x00 0x08 0x00 0x00 +Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 + cmd=0x59 rsp=0xcc): Invalid data field in request +Command : ipmitool raw 0x06 0x59 0x00 0x3f 0x00 0x00 +Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 + cmd=0x59 rsp=0xcc): Invalid data field in request + +Signed-off-by: Snehalatha V <SnehalathaX.V@intel.com> +Change-Id: I2a98b91bad199dc4eeac68b68972c3355cb5ec2f +--- + apphandler.cpp | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/apphandler.cpp b/apphandler.cpp +index 4ba637f..90818a9 100644 +--- a/apphandler.cpp ++++ b/apphandler.cpp +@@ -1289,10 +1289,15 @@ ipmi::RspType<uint8_t, // Parameter revision + uint8_t paramSelector, uint8_t setSelector, + uint8_t BlockSelector) + { +- if (reserved) ++ if (reserved || (paramSelector >= invalidParamSelectorStart && ++ paramSelector <= invalidParamSelectorEnd)) + { + return ipmi::responseInvalidFieldRequest(); + } ++ if ((paramSelector >= oemCmdStart) && (paramSelector <= oemCmdEnd)) ++ { ++ return ipmi::responseParmNotSupported(); ++ } + if (getRevision) + { + return ipmi::responseSuccess(paramRevision, std::nullopt, std::nullopt); +@@ -1322,7 +1327,7 @@ ipmi::RspType<uint8_t, // Parameter revision + bool found = std::get<0>(ret); + if (!found) + { +- return ipmi::responseParmNotSupported(); ++ return ipmi::responseSensorInvalid(); + } + std::string& paramString = std::get<1>(ret); + std::vector<uint8_t> configData; +@@ -1334,7 +1339,14 @@ ipmi::RspType<uint8_t, // Parameter revision + count = std::min(paramString.length(), smallChunkSize); + configData.resize(count + configDataOverhead); + std::copy_n(paramString.begin(), count, +- configData.begin() + configDataOverhead); // 14 bytes thunk ++ configData.begin() + configDataOverhead); // 14 bytes chunk ++ ++ // Append zero's to remaining bytes ++ if (configData.size() < configParameterLength) ++ { ++ std::fill_n(std::back_inserter(configData), ++ configParameterLength - configData.size(), 0x00); ++ } + } + else + { +-- +2.17.1 + |