Skip to content

Commit c03a487

Browse files
committed
ipmi:ipmb: Fix unknown command response
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 <[email protected]>
1 parent d2c12f5 commit c03a487

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,9 +3920,11 @@ static int handle_ipmb_direct_rcv_cmd(struct ipmi_smi *intf,
39203920
/* We didn't find a user, deliver an error response. */
39213921
ipmi_inc_stat(intf, unhandled_commands);
39223922

3923-
msg->data[0] = ((netfn + 1) << 2) | (msg->rsp[4] & 0x3);
3924-
msg->data[1] = msg->rsp[2];
3925-
msg->data[2] = msg->rsp[4] & ~0x3;
3923+
msg->data[0] = (netfn + 1) << 2;
3924+
msg->data[0] |= msg->rsp[2] & 0x3; /* rqLUN */
3925+
msg->data[1] = msg->rsp[1]; /* Addr */
3926+
msg->data[2] = msg->rsp[2] & ~0x3; /* rqSeq */
3927+
msg->data[2] |= msg->rsp[0] & 0x3; /* rsLUN */
39263928
msg->data[3] = cmd;
39273929
msg->data[4] = IPMI_INVALID_CMD_COMPLETION_CODE;
39283930
msg->data_size = 5;

0 commit comments

Comments
 (0)