]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ipmi:ipmb: Fix unknown command response
authorCorey Minyard <cminyard@mvista.com>
Thu, 25 Nov 2021 17:23:20 +0000 (11:23 -0600)
committerCorey Minyard <cminyard@mvista.com>
Fri, 26 Nov 2021 03:17:55 +0000 (21:17 -0600)
More missed changes, the response back to another system sending a
command that had no user to handle it wasn't formatted properly.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_msghandler.c

index 99ea6d9b3716dd5be117655e69f95b947d76a952..c837d5416e0eeeb9ca578f23d75f8141be5e9481 100644 (file)
@@ -3920,9 +3920,11 @@ static int handle_ipmb_direct_rcv_cmd(struct ipmi_smi *intf,
                /* We didn't find a user, deliver an error response. */
                ipmi_inc_stat(intf, unhandled_commands);
 
-               msg->data[0] = ((netfn + 1) << 2) | (msg->rsp[4] & 0x3);
-               msg->data[1] = msg->rsp[2];
-               msg->data[2] = msg->rsp[4] & ~0x3;
+               msg->data[0] = (netfn + 1) << 2;
+               msg->data[0] |= msg->rsp[2] & 0x3; /* rqLUN */
+               msg->data[1] = msg->rsp[1]; /* Addr */
+               msg->data[2] = msg->rsp[2] & ~0x3; /* rqSeq */
+               msg->data[2] |= msg->rsp[0] & 0x3; /* rsLUN */
                msg->data[3] = cmd;
                msg->data[4] = IPMI_INVALID_CMD_COMPLETION_CODE;
                msg->data_size = 5;