mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-14 12:19:43 +03:00
Merge pull request #178 from mrdeep1/tid-duplication
Verify tid is not being re-used in a session
This commit is contained in:
1 file changed
+8
@@ -252,6 +252,14 @@ coap_session_delay_pdu(coap_session_t *session, coap_pdu_t *pdu,
|
||||
node->session = NULL;
|
||||
node->t = 0;
|
||||
} else {
|
||||
coap_queue_t *q = NULL;
|
||||
/* Check that the same tid is not getting re-used in violation of RFC7252 */
|
||||
LL_FOREACH(session->sendqueue, q) {
|
||||
if (q->id == pdu->tid) {
|
||||
coap_log(LOG_ERR, "** %s tid=%d: already in-use - dropped\n", coap_session_str(session), pdu->tid);
|
||||
return COAP_INVALID_TID;
|
||||
}
|
||||
}
|
||||
node = coap_new_node();
|
||||
if (node == NULL)
|
||||
return COAP_INVALID_TID;
|
||||
|
||||
Reference in new issue
Block a user