[mesh-forwarder] clear children's indirect msg and src match table on stop (#3933)

This commit ensures to clear the indirect message pointer on all
children and reset the indirect message count (which in turn clear the
source match table) from `MeshForwarder::Stop()`. This addresses the
issue where on an `Stop()`/`Start()` call the source match table can
become out of sync with the send queue and/or a child may hold on to
an already freed `Message`.
This commit is contained in:
Abtin Keshavarzian
2019-06-21 15:41:26 -07:00
committed by Jonathan Hui
parent 44596e2299
commit adecc05755
+6
View File
@@ -132,6 +132,12 @@ void MeshForwarder::Stop(void)
}
#if OPENTHREAD_FTD
for (ChildTable::Iterator iter(GetInstance(), ChildTable::kInStateAnyExceptInvalid); !iter.IsDone(); iter++)
{
iter.GetChild()->SetIndirectMessage(NULL);
Get<SourceMatchController>().ResetMessageCount(*iter.GetChild());
}
memset(mFragmentEntries, 0, sizeof(mFragmentEntries));
#endif