diff options
author | Justin.Lee1@Dell.com <Justin.Lee1@Dell.com> | 2019-08-21 21:24:52 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-22 19:27:02 -0700 |
commit | f6edbf2d616435cda7823942c20005ce198e97c8 (patch) | |
tree | 968cc0fdb19efe96be96ac33f8d189069f97993c /net | |
parent | 4df0d839babdcd2a17cae52f112afa148d48289f (diff) | |
download | linux-f6edbf2d616435cda7823942c20005ce198e97c8.tar.gz linux-f6edbf2d616435cda7823942c20005ce198e97c8.tar.bz2 linux-f6edbf2d616435cda7823942c20005ce198e97c8.zip |
net/ncsi: Fix the payload copying for the request coming from Netlink
The request coming from Netlink should use the OEM generic handler.
The standard command handler expects payload in bytes/words/dwords
but the actual payload is stored in data if the request is coming from Netlink.
Signed-off-by: Justin Lee <justin.lee1@dell.com>
Reviewed-by: Vijay Khemka <vijaykhemka@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ncsi/ncsi-cmd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c index eab4346b0a39..0187e65176c0 100644 --- a/net/ncsi/ncsi-cmd.c +++ b/net/ncsi/ncsi-cmd.c @@ -309,14 +309,21 @@ static struct ncsi_request *ncsi_alloc_command(struct ncsi_cmd_arg *nca) int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca) { + struct ncsi_cmd_handler *nch = NULL; struct ncsi_request *nr; + unsigned char type; struct ethhdr *eh; - struct ncsi_cmd_handler *nch = NULL; int i, ret; + /* Use OEM generic handler for Netlink request */ + if (nca->req_flags == NCSI_REQ_FLAG_NETLINK_DRIVEN) + type = NCSI_PKT_CMD_OEM; + else + type = nca->type; + /* Search for the handler */ for (i = 0; i < ARRAY_SIZE(ncsi_cmd_handlers); i++) { - if (ncsi_cmd_handlers[i].type == nca->type) { + if (ncsi_cmd_handlers[i].type == type) { if (ncsi_cmd_handlers[i].handler) nch = &ncsi_cmd_handlers[i]; else |