From ae5075682b52e0bf72f403f646d0487bfbf913fa Mon Sep 17 00:00:00 2001 From: rwrozelle Date: Fri, 21 Nov 2025 00:46:54 -0500 Subject: [PATCH] [coap] block2 fix PrepareNextBlockRequest to provide token from next request (#12097) --- src/core/coap/coap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/coap/coap.cpp b/src/core/coap/coap.cpp index 6c5328aec..346d164a6 100644 --- a/src/core/coap/coap.cpp +++ b/src/core/coap/coap.cpp @@ -640,6 +640,8 @@ Error CoapBase::PrepareNextBlockRequest(Message::BlockType aType, blockOption = (aType == Message::kBlockType1) ? kOptionBlock1 : kOptionBlock2; aRequest.Init(kTypeConfirmable, static_cast(aRequestOld.GetCode())); + // Per RFC 7959, all requests in a block-wise transfer MUST use the same token. + IgnoreError(aRequest.SetTokenFromMessage(aRequestOld)); SuccessOrExit(error = iterator.Init(aRequestOld)); // Copy options from last response to next message