Skip to content

Commit 4872527

Browse files
rlubosdanieldegrasse
authored andcommitted
net: coap_client: Don't send RST on unrecognized ACK response
According to CoAP RFC (7252, ch. 4.2), Reset cannot be sent in a response for an ACK reply, rejected ACKs should be silently ignored instead. Therefore, in case an unrecognized response is received, verify the response type before sending Reset. Signed-off-by: Robert Lubos <[email protected]>
1 parent 3ff4d05 commit 4872527

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

subsys/net/lib/coap/coap_client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,10 @@ static int handle_response(struct coap_client *client, const struct coap_packet
818818
internal_req = get_request_with_token(client, response);
819819
if (!internal_req) {
820820
LOG_WRN("No matching request for response");
821-
(void) send_rst(client, response); /* Ignore errors, unrelated to our queries */
821+
if (response_type != COAP_TYPE_ACK) {
822+
/* Ignore errors, unrelated to our queries */
823+
(void)send_rst(client, response);
824+
}
822825
return 0;
823826
}
824827

0 commit comments

Comments
 (0)