mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 04:00:10 +00:00
[mlr] simplify multicast address state tracking (#13089)
This commit simplifies the tracking of Multicast Listener Registration (MLR) state for IPv6 addresses by removing intermediate states and relying on the original CoAP request payload. Previously, `Mlr::Manager` used a 3-state system (`kStateToRegister`, `kStateRegistering`, `kStateRegistered`) which required core structures like `Child` and `Netif` to track transient registration states. This commit reduces the state to a single boolean (`IsMlrRegistered`) tracked in `ChildTable` and `ThreadNetif`. When a CoAP response is received, `Mlr::Manager` now uses `GetDispatchingRequest()` to retrieve the original TMR MLE request message, parses the `Ip6AddressesTlv` to determine exactly which addresses were included in the request, and updates the registration states based purely on this info (minus any explicitly failed addresses). This change improves robustness, reduces RAM usage by eliminating state-tracking arrays, and significantly cleans up the logical flow within the MLR manager.
This commit is contained in:
@@ -1874,12 +1874,7 @@ Error Mle::ProcessAddressRegistrationTlv(RxInfo &aRxInfo, Child &aChild)
|
||||
{
|
||||
for (const Child::Ip6AddrEntry &addrEntry : aChild.GetIp6Addresses())
|
||||
{
|
||||
if (!addrEntry.IsMulticastLargerThanRealmLocal())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (addrEntry.GetMlrState(aChild) == Mlr::kStateRegistered)
|
||||
if (addrEntry.IsMlrRegistered(aChild))
|
||||
{
|
||||
IgnoreError(oldMlrRegisteredAddresses.PushBack(addrEntry));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user