mctpd: fix zeroed ctrl_hdr in endpoint discovery#151
mctpd: fix zeroed ctrl_hdr in endpoint discovery#151jk-ozlabs merged 1 commit intoCodeConstruct:mainfrom
Conversation
bb0fd09 to
e5deb79
Compare
Can we have a little explanation about the error here? For example, what behaviour are you seeing that this fixes? |
| } | ||
|
|
||
| req = (void *)buf; | ||
| resp = (void *)resp; |
There was a problem hiding this comment.
This resp assignment (from the original) doesn't seem to do anything. May as well remove it.
There was a problem hiding this comment.
Hi.
In mctp_ctrl_msg_hdr_init_resp(&resp->ctrl_hdr, *req); both variables are used.
Please confirm.
There was a problem hiding this comment.
More that the statement
resp = (void *)resp
does not do anything
There was a problem hiding this comment.
Understood, removed the redundant line.
In handle_control_endpoint_discovery(), the response header initialization (mctp_ctrl_msg_hdr_init_resp) was placed after the DISCOVERY_UNSUPPORTED check. When the interface has discovery unsupported, the function would call reply_message() with a zeroed ctrl_hdr, sending a response with no command code and no instance ID Move the req/resp pointer setup and mctp_ctrl_msg_hdr_init_resp() call so that response carries a correctly initialized control header. Signed-off-by: Nidhin MS <nidhin.ms@intel.com>
Updated PR description |
I was more after an update to the commit message; so we have a better chance of correlating fixes to their behaviours in future. |
e5deb79 to
aa65d0a
Compare
Hi. Updated commit message. |
0a9d89a to
2531e91
Compare
In handle_control_endpoint_discovery(), the response header
initialization (mctp_ctrl_msg_hdr_init_resp) was placed after the
DISCOVERY_UNSUPPORTED check. When the interface has discovery
unsupported, the function would call reply_message() with a zeroed
ctrl_hdr, sending a response with no command code and no instance ID
Move the req/resp pointer setup and mctp_ctrl_msg_hdr_init_resp()
call so that response carries a correctly initialized control header.