From ddb1f443d1d6e76949a230847e6145b108114a40 Mon Sep 17 00:00:00 2001 From: anil kumar appana Date: Thu, 4 Jul 2019 18:07:27 +0000 Subject: channelcmds:fix set chnl access sessionless chnl Return proper error code 0x82 for session-less channel Tested 1.verified with ipmitool raw commands ipmitool raw 0x06 0x40 0x00 0x40 0x04 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x40 rsp=0x82): Unknown (0x82) ipmitool raw 0x06 0x41 0x00 0x40 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x41 rsp=0x82): Unknown (0x82) Signed-off-by: anil kumar appana Change-Id: I9ada001427a6c3dcaaf6de026f8831faa54c182d --- user_channel/channelcommands.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'user_channel') diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp index 9d3b4d2..adf19d5 100644 --- a/user_channel/channelcommands.cpp +++ b/user_channel/channelcommands.cpp @@ -26,6 +26,8 @@ using namespace phosphor::logging; namespace ipmi { +static constexpr const uint8_t ccActionNotSupportedForChannel = 0x82; + /** @brief implements the set channel access command * @ param ctx - context pointer * @ param channel - channel number @@ -59,7 +61,7 @@ RspType<> ipmiSetChannelAccess(Context::ptr ctx, uint4_t channel, if (getChannelSessionSupport(chNum) == EChannelSessSupported::none) { log("Set channel access - No support on channel"); - return responseInvalidFieldRequest(); + return response(ccActionNotSupportedForChannel); } ChannelAccess chActData; @@ -188,7 +190,7 @@ ipmi ::RspType("Get channel access - No support on channel"); - return response(IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL); + return response(ccActionNotSupportedForChannel); } ChannelAccess chAccess; -- cgit v1.2.1