From b932edc77251d1e26a0a1ded9ffdef46cbf5a23e Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 8 Oct 2020 10:06:46 +0200 Subject: [PATCH] net: lwm2m: Fix bootstrap finish response code LwM2M engine did not set response code for the Bootstrap-finish message, hence it replied with the code copied from the request which is not correct. Fix this by setting correct code for the Bootstrap-finish reply. Signed-off-by: Robert Lubos --- subsys/net/lib/lwm2m/lwm2m_engine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index d88a1d4b845..327d963c177 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -3354,6 +3354,8 @@ static int handle_request(struct coap_packet *request, strncmp(options[0].value, "bs", options[0].len) == 0) { engine_bootstrap_finish(); + msg->code = COAP_RESPONSE_CODE_CHANGED; + r = lwm2m_init_message(msg); if (r < 0) { goto error;