From cedf29f2c7fe70943254fd5002abae9210e30ddf Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Thu, 26 Jul 2018 15:39:51 -0700 Subject: [PATCH] app_cmds: Correct keep alive response The keep alive response is not identical to the request, so create a new (empty) message rather than looping the invalid sized message back. Signed-off-by: Bjorn Andersson --- router/app_cmds.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/router/app_cmds.c b/router/app_cmds.c index 4550ac9..0829a01 100644 --- a/router/app_cmds.c +++ b/router/app_cmds.c @@ -96,7 +96,14 @@ static int handle_extended_build_id(struct diag_client *client, static int handle_keep_alive(struct diag_client *client, const void *buf, size_t len) { - return dm_send(client, buf, len); + uint8_t resp[16]; + + resp[0] = DIAG_CMD_SUBSYS_DISPATCH; + resp[1] = DIAG_CMD_KEEP_ALIVE_SUBSYS; + resp[2] = DIAG_CMD_KEEP_ALIVE_CMD; + memset(resp + 3, 0, sizeof(resp) - 3); + + return dm_send(client, resp, sizeof(resp)); } void register_app_cmds(void)