Skip to content

Commit 8101c92

Browse files
mctpd: fix incorrect response of Get Message Type Support
The response doesn't include the list of message type numbers. Correct the response length to fix this issue. Signed-off-by: Steven Lee <[email protected]>
1 parent f9a5618 commit 8101c92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mctpd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ static int handle_control_get_message_type_support(ctx *ctx,
697697
struct mctp_ctrl_cmd_get_msg_type_support *req = NULL;;
698698
struct mctp_ctrl_resp_get_msg_type_support *resp = NULL;
699699
uint8_t resp_buf[sizeof(*resp) + 1];
700+
size_t resp_len;
700701

701702
if (buf_size < sizeof(*req)) {
702703
warnx("short Get Message Type Support message");
@@ -711,8 +712,9 @@ static int handle_control_get_message_type_support(ctx *ctx,
711712
// Only control messages supported
712713
resp->msg_type_count = 1;
713714
*((uint8_t*)(resp+1)) = MCTP_CTRL_HDR_MSG_TYPE;
715+
resp_len = sizeof(*resp) + resp->msg_type_count;
714716

715-
return reply_message(ctx, sd, resp, sizeof(*resp), addr);
717+
return reply_message(ctx, sd, resp, resp_len, addr);
716718
}
717719

718720
static int handle_control_resolve_endpoint_id(ctx *ctx,

0 commit comments

Comments
 (0)