net: lwm2m: Reset only messages owned by lwm2m context
The context should only clear messages it owns, not all of them. Since both context (LwM2M and FOTA) share common message pool, they might interrupt their operation otherwise (i. e. cancel retransmissions). Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
8b22521b6b
commit
2eb633d12e
1 changed files with 4 additions and 3 deletions
|
@ -4032,9 +4032,10 @@ int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0, msg = messages; i < CONFIG_LWM2M_ENGINE_MAX_MESSAGES;
|
||||
i++, msg++) {
|
||||
memset(msg, 0, sizeof(struct lwm2m_message));
|
||||
for (i = 0, msg = messages; i < ARRAY_SIZE(messages); i++, msg++) {
|
||||
if (msg->ctx == client_ctx) {
|
||||
lwm2m_reset_message(msg, true);
|
||||
}
|
||||
}
|
||||
|
||||
coap_pendings_clear(client_ctx->pendings,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue