net: lwm2m: Handle RESET replies for separate response

Separate CON responses do no have a reply callback registered (as no
response is expected), however are still registered for retransmission
on the pending list. Therefore, we not only need to check for empty
ACKs for such case but for RESET packets as well. However, this cannot
be done before "reply" processing, as some of the reply handlers
(notifications namely) check for RESET replies.

Therefore, add a final check for the RESET response after the existing
"reply" logic. In such case, just remove the pending response packet
from the retransmission queue, and release resources.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos
2025-07-18 16:59:23 +02:00
committed by Chris Friedt
parent cf28b5aa65
commit d3ba674a51

View File

@@ -2881,6 +2881,16 @@ void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx, uint8_t *buf, uint16_t buf_
LOG_DBG("reply %p handled and removed", reply);
goto client_unlock;
} else if (pending && coap_header_get_type(&response) == COAP_TYPE_RESET) {
msg = find_msg(pending, NULL);
if (msg == NULL) {
LOG_ERR("Orphaned pending %p.", pending);
coap_pending_clear(pending);
goto client_unlock;
}
lwm2m_reset_message(msg, true);
goto client_unlock;
}
lwm2m_client_unlock(client_ctx);