mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 22:57:47 +00:00
[mle] simplify signaling of DUA address change (#10296)
This commit simplifies how `ProcessAddressRegistrationTlv()` signals DUA address changes. Signaling now occurs after all child addresses are registered, using a new `SignalDuaAddressEvent()` method. This method checks the old and new DUA addresses to determine the appropriate event to signal. Additionally, `Child::GetDomainUnicastAddress()` is updated to return an `Error` and copy the DUA address into a provided `Ip6::Address` reference.
This commit is contained in:
@@ -480,9 +480,8 @@ void DuaManager::PerformNextRegistration(void)
|
||||
#endif // OPENTHREAD_CONFIG_DUA_ENABLE
|
||||
{
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE
|
||||
uint32_t lastTransactionTime;
|
||||
const Ip6::Address *duaPtr = nullptr;
|
||||
Child *child = nullptr;
|
||||
uint32_t lastTransactionTime;
|
||||
Child *child = nullptr;
|
||||
|
||||
OT_ASSERT(mChildIndexDuaRegistering == Mle::kMaxChildren);
|
||||
|
||||
@@ -497,12 +496,9 @@ void DuaManager::PerformNextRegistration(void)
|
||||
}
|
||||
}
|
||||
|
||||
child = Get<ChildTable>().GetChildAtIndex(mChildIndexDuaRegistering);
|
||||
duaPtr = child->GetDomainUnicastAddress();
|
||||
child = Get<ChildTable>().GetChildAtIndex(mChildIndexDuaRegistering);
|
||||
SuccessOrAssert(child->GetDomainUnicastAddress(dua));
|
||||
|
||||
OT_ASSERT(duaPtr != nullptr);
|
||||
|
||||
dua = *duaPtr;
|
||||
SuccessOrExit(error = Tlv::Append<ThreadTargetTlv>(*message, dua));
|
||||
SuccessOrExit(error = Tlv::Append<ThreadMeshLocalEidTlv>(*message, child->GetMeshLocalIid()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user