Skip to content

Commit

Permalink
gcoap: send empty RST on unknown CON response
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Aug 9, 2022
1 parent c125e3d commit 2cd7857
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sys/net/application_layer/gcoap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2cd7857

Please # to comment.