mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 06:37:46 +00:00
[mesh-forwarder] Clear child's indirect message pointer when removing all its messages (#2456)
This commit changes the `ClearChildIndirectMessages(aChild)` method in `MeshForwarder` to ensure that it also clears the indirect message pointer on the child entry. This addresses a subtle bug in the code in the following situation: If we happen to receive a "Child Id Request" from an already valid child for which we are in the middle of an indirect transmission, from `MleRouter::HandleChildIdRequest()` all queued indirect messages for the child are removed (through `MleRouter::RemoveNeighbor()` call). This would then free the indirect message while the child still kept a pointer to the freed message.
This commit is contained in:
committed by
Jonathan Hui
parent
e86e5ca7cf
commit
7d193c422f
@@ -211,6 +211,7 @@ void MeshForwarder::ClearChildIndirectMessages(Child &aChild)
|
||||
}
|
||||
}
|
||||
|
||||
aChild.SetIndirectMessage(NULL);
|
||||
mSourceMatchController.ResetMessageCount(aChild);
|
||||
|
||||
exit:
|
||||
|
||||
Reference in New Issue
Block a user