Skip to content

Commit

Permalink
gcoap: issue RST on unknown observe notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelRottleuthner committed Nov 15, 2023
1 parent 0085b67 commit 750d156
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 @@ -536,6 +536,13 @@ static void _process_coap_pdu(gcoap_socket_t *sock, sock_udp_ep_t *remote, sock_
messagelayer_emptyresponse_type = COAP_TYPE_RST;
DEBUG("gcoap: Answering unknown CON response with RST to "
"shut up sender\n");
} else {
/* if the response was a (NON) observe notification and there is no
* matching request, the server must be informed that this node is
* no longer interested in this notification. */
if (coap_has_observe(&pdu)) {
messagelayer_emptyresponse_type = COAP_TYPE_RST;
}
}
}
break;
Expand Down

0 comments on commit 750d156

Please sign in to comment.