GetPayloadVerCmd:Fix ErrCode IncorrectPayloadType
The error code 0x82 is returned for session less channels in
Get Payload Version command. The correct error code is
0x80 Payload type not available on given channel.
Tested:
Channels configured as multi-session:
The channels 1,2,3,4 are configurated for LAN ports (eth0-3).
Channels configured as session-less:
The channel 0 for IPMB, channel 8 for INTRABMC and
channel 0xf for system interface
Case 1: Response for session less channels 0,8 and 0xf
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x00 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0x80): Unknown (0x80)
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x08 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0x80): Unknown (0x80)
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0f 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0x80): Unknown (0x80)
Case 2: Response for channels 1,2,3,4 (LAN) and 0xE (Present I/F)
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x01 0x00
Response: 10
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x02 0x00
Response: 10
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x03 0x00
Response: 10
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x04 0x00
Response: 10
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0E 0x00
Response: 10
Case 3: Response for unconfigured channels 5,6,7,9,0xA,0xB,0xC and 0xD
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x05 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x06 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x07 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x09 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0a 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0b 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0c 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Command: ipmitool -I lanplus -H <BMC IP> -U <user> -P <passwd> -C 17
raw 0x06 0x4F 0x0d 0x00
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x4f rsp=0xcc): Invalid data field in request
Signed-off-by: Manoj Ashok <amanoj@ami.com>
Change-Id: Ib0a57bc007194620f8a12a5f30512265c011f85e
diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp
index de32316..769f9ff 100644
--- a/user_channel/channelcommands.cpp
+++ b/user_channel/channelcommands.cpp
@@ -369,6 +369,7 @@
{
uint8_t channel =
convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
+ constexpr uint8_t payloadTypeNotSupported = 0x80;
if (reserved || !isValidChannel(channel))
{
@@ -381,7 +382,7 @@
{
log<level::DEBUG>(
"Get channel payload version - No support on channel");
- return response(ccActionNotSupportedForChannel);
+ return response(payloadTypeNotSupported);
}
if (!isValidPayloadType(static_cast<PayloadType>(payloadTypeNum)))
@@ -389,7 +390,6 @@
log<level::ERR>(
"Get channel payload version - Payload type unavailable");
- constexpr uint8_t payloadTypeNotSupported = 0x80;
return response(payloadTypeNotSupported);
}