[mle] update HandleAdv to not exit when deciding to promote to router (#8645)

This commit updates `MleRouter::HandleAdvertisement()` to not call
`ExitNow()` and exit early when as a child we decide to try to
promote to router role and set `mRouterSelectionJitterTimeout`. This
ensures that we continue processing the message and call
`UpdateRoutesOnFed()` and `router->SetLastHeard()`.
This commit is contained in:
Abtin Keshavarzian
2023-01-11 23:12:15 -08:00
committed by GitHub
parent 22fa54dfa2
commit 66933e4fcc
-1
View File
@@ -1259,7 +1259,6 @@ Error MleRouter::HandleAdvertisement(RxInfo &aRxInfo, uint16_t aSourceAddress, c
if ((mRouterSelectionJitterTimeout == 0) && (mRouterTable.GetActiveRouterCount() < mRouterUpgradeThreshold))
{
mRouterSelectionJitterTimeout = 1 + Random::NonCrypto::GetUint8InRange(0, mRouterSelectionJitter);
ExitNow();
}
mRouterTable.UpdateRoutesOnFed(routeTlv, routerId);