mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 11:47:46 +00:00
[coap] fix handling message id 0 (#2104)
This commit is contained in:
@@ -175,7 +175,8 @@ otError Coap::SendMessage(Message &aMessage, const Ip6::MessageInfo &aMessageInf
|
||||
}
|
||||
|
||||
// Set Message Id if it was not already set.
|
||||
if (header.GetMessageId() == 0)
|
||||
if (header.GetMessageId() == 0 &&
|
||||
(header.GetType() == OT_COAP_TYPE_CONFIRMABLE || header.GetType() == OT_COAP_TYPE_NON_CONFIRMABLE))
|
||||
{
|
||||
header.SetMessageId(mMessageId++);
|
||||
aMessage.Write(0, Header::kMinHeaderLength, header.GetBytes());
|
||||
|
||||
Reference in New Issue
Block a user