Closed jvermillard closed 4 months ago
looks like this solution works:
diff --git a/samples/net/sockets/coap_server/src/separate.c b/samples/net/sockets/coap_server/src/separate.c
index 68bba0bb47..7a5b1737cb 100644
--- a/samples/net/sockets/coap_server/src/separate.c
+++ b/samples/net/sockets/coap_server/src/separate.c
@@ -57,7 +57,7 @@ static int separate_get(struct coap_resource *resource,
/* Re-use the buffer */
r = coap_packet_init(&response, data, sizeof(data),
COAP_VERSION_1, type, tkl, token,
- COAP_RESPONSE_CODE_CONTENT, id);
+ COAP_RESPONSE_CODE_CONTENT, coap_next_id());
if (r < 0) {
return r;
}
The net/socket/coap_server/seperate.c resource showing how to do separate coap response is reusing the MID between the request and the response, it should be different MID:
To Reproduce Steps to reproduce the behavior:
Expected behavior The response 2.05 and the following ACK should use a different MID
Impact Since the message reuses the MID, the peer implementation could discard them as spurious retransmissions.