diff options
author | Corey Minyard <cminyard@mvista.com> | 2021-11-25 18:23:20 +0100 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2021-11-26 04:17:55 +0100 |
commit | c03a487a83fddbca1ef6cb5b97a69cd3e390e233 (patch) | |
tree | 928eca22476a86bc87b654fc5909b6143d2e216b /drivers/char | |
parent | ipmi: fix IPMI_SMI_MSG_TYPE_IPMB_DIRECT response length checking (diff) | |
download | linux-c03a487a83fddbca1ef6cb5b97a69cd3e390e233.tar.xz linux-c03a487a83fddbca1ef6cb5b97a69cd3e390e233.zip |
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 <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 99ea6d9b3716..c837d5416e0e 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -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; |