net: lwm2m: cancel pending retransmit work when closing context
Currently the retransmit_work is not cancelled when closing a context, making it operate on an invalid context. LwM2M RD client also closes the context and initializes it again when registration with the server fails, overwriting the active timeout and breaking the timeout dlist. Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
This commit is contained in:
parent
d4310c0762
commit
d0dd1fbf5c
1 changed files with 3 additions and 0 deletions
|
@ -3821,6 +3821,9 @@ int lwm2m_engine_context_close(struct lwm2m_ctx *client_ctx)
|
||||||
sys_snode_t *prev_node = NULL;
|
sys_snode_t *prev_node = NULL;
|
||||||
int sock_fd = client_ctx->sock_fd;
|
int sock_fd = client_ctx->sock_fd;
|
||||||
|
|
||||||
|
/* Cancel pending retransmit work */
|
||||||
|
k_delayed_work_cancel(&client_ctx->retransmit_work);
|
||||||
|
|
||||||
/* Remove observes for this context */
|
/* Remove observes for this context */
|
||||||
SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&engine_observer_list,
|
SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&engine_observer_list,
|
||||||
obs, tmp, node) {
|
obs, tmp, node) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue