1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gcoap: send empty RST on unknown CON response

This commit is contained in:
Martine S. Lenders 2022-08-09 16:18:57 +02:00 committed by Martine Lenders
parent c125e3d98a
commit 2cd785791d
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -487,6 +487,13 @@ static void _process_coap_pdu(gcoap_socket_t *sock, sock_udp_ep_t *remote, sock_
}
else {
DEBUG("gcoap: msg not found for ID: %u\n", coap_get_id(&pdu));
if (coap_get_type(&pdu) == COAP_TYPE_CON) {
/* we might run into this if an ACK to a sender got lost
* see https://datatracker.ietf.org/doc/html/rfc7252#section-5.3.2 */
messagelayer_emptyresponse_type = COAP_TYPE_RST;
DEBUG("gcoap: Answering unknown CON response with RST to "
"shut up sender\n");
}
}
break;
default: