[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:
Abtin Keshavarzian
2026-05-11 16:46:17 -07:00
committed by GitHub
parent 1f24ace91a
commit ddfd66526e
9 changed files with 191 additions and 342 deletions
+1 -6
View File
@@ -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));
}