summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyushi Smriti <smriti.ayushi@linux.intel.com>2019-09-03 11:43:45 +0530
committersmriti.ayushi <smriti.ayushi@linux.intel.com>2019-09-25 05:36:40 +0000
commitd7dadc27792747c00c3bfef4fc45d6f3184ba815 (patch)
treef2ff81858f091064c4a08c666e5e37a3b0009c03
parent5c3b72c6c167bf69de1dfd813745a7170b5ae995 (diff)
downloadphosphor-host-ipmid-d7dadc27792747c00c3bfef4fc45d6f3184ba815.tar.gz
phosphor-host-ipmid-d7dadc27792747c00c3bfef4fc45d6f3184ba815.zip
Fix: execute get channel cipher suite in lan chan
Get channel cipher suites command was executed for non lan channels. Fixing the same by adding active lan channel support check. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //cmd executed for lan chan 1 ipmitool raw 0x06 0x54 0x00 0x00 0x80 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0xcc): Invalid data field in request //cc resulted for non lan chan 0 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ic3c2dfa3f4537be789e2afc912fa8f4c2a49bda4
-rw-r--r--app/channel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/channel.cpp b/app/channel.cpp
index 91cbe88..7006c92 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -148,6 +148,15 @@ ipmi::RspType<uint8_t, // Channel Number
algoSelectBit ? cipherRecords : supportedAlgorithms;
static constexpr auto respSize = 16;
+ // Session support is available in active LAN channels.
+ if ((ipmi::getChannelSessionSupport(rspChannel) ==
+ ipmi::EChannelSessSupported::none) ||
+ !(ipmi::doesDeviceExist(rspChannel)))
+ {
+ log<level::DEBUG>("Get channel cipher suites - Device does not exist");
+ return ipmi::responseInvalidFieldRequest();
+ }
+
// List index(00h-3Fh), 0h selects the first set of 16, 1h selects the next
// set of 16 and so on.
OpenPOWER on IntegriCloud