[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:
Abtin Keshavarzian
2018-01-06 01:43:51 +00:00
committed by Jonathan Hui
parent e86e5ca7cf
commit 7d193c422f
+1
View File
@@ -211,6 +211,7 @@ void MeshForwarder::ClearChildIndirectMessages(Child &aChild)
}
}
aChild.SetIndirectMessage(NULL);
mSourceMatchController.ResetMessageCount(aChild);
exit: