[mle] simplify tracking of registered DUA address by child (#9137)

This commit is contained in:
Abtin Keshavarzian
2023-06-06 15:06:21 -07:00
committed by GitHub
parent 7e8f77b55e
commit 982057e095
5 changed files with 66 additions and 58 deletions
+4 -5
View File
@@ -758,12 +758,11 @@ exit:
}
}
void DuaManager::UpdateChildDomainUnicastAddress(const Child &aChild, Mle::ChildDuaState aState)
void DuaManager::HandleChildDuaAddressEvent(const Child &aChild, ChildDuaAddressEvent aEvent)
{
uint16_t childIndex = Get<ChildTable>().GetChildIndex(aChild);
if ((aState == Mle::ChildDuaState::kRemoved || aState == Mle::ChildDuaState::kChanged) &&
mChildDuaMask.Get(childIndex))
if ((aEvent == kAddressRemoved || aEvent == kAddressChanged) && mChildDuaMask.Get(childIndex))
{
// Abort on going proxy DUA.req for this child
if (mChildIndexDuaRegistering == childIndex)
@@ -775,8 +774,8 @@ void DuaManager::UpdateChildDomainUnicastAddress(const Child &aChild, Mle::Child
mChildDuaRegisteredMask.Set(childIndex, false);
}
if (aState == Mle::ChildDuaState::kAdded || aState == Mle::ChildDuaState::kChanged ||
(aState == Mle::ChildDuaState::kUnchanged && !mChildDuaMask.Get(childIndex)))
if (aEvent == kAddressAdded || aEvent == kAddressChanged ||
(aEvent == kAddressUnchanged && !mChildDuaMask.Get(childIndex)))
{
if (mChildDuaMask == mChildDuaRegisteredMask)
{