mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 11:19:51 +00:00
[mesh-forwarder] ensure message allocation with correct priority (#7203)
This commit fixes the incorrect call to `MessagePool::New()` to allocate a message in `MeshForwarder::HandleMesh()` method. The existing code calls `New(Message::kType6lowpan, priority)` with two parameters which maps to the flavor `New()` method with three parameters with last one (`Message::Settings`) being optional (having a default value). Basically, the existing code treats the `priority` (second argument) as `aReserveHeader` parameter in the `New()` instead of the message priority.
This commit is contained in:
@@ -805,7 +805,7 @@ void MeshForwarder::HandleMesh(uint8_t * aFrame,
|
||||
meshHeader.DecrementHopsLeft();
|
||||
|
||||
GetForwardFramePriority(aFrame, aFrameLength, meshSource, meshDest, priority);
|
||||
message = Get<MessagePool>().New(Message::kType6lowpan, priority);
|
||||
message = Get<MessagePool>().New(Message::kType6lowpan, /* aReserveHeader */ 0, priority);
|
||||
VerifyOrExit(message != nullptr, error = kErrorNoBufs);
|
||||
|
||||
SuccessOrExit(error = message->SetLength(meshHeader.GetHeaderLength() + aFrameLength));
|
||||
|
||||
Reference in New Issue
Block a user