diff --git a/src/core/thread/dua_manager.cpp b/src/core/thread/dua_manager.cpp index c8a1b3982..fbbce8cb0 100644 --- a/src/core/thread/dua_manager.cpp +++ b/src/core/thread/dua_manager.cpp @@ -321,7 +321,7 @@ void DuaManager::HandleNotifierEvents(Events aEvents) // Wait for link establishment with neighboring routers. UpdateRegistrationDelay(kNewRouterRegistrationDelay); } - else if (mle.IsExpectedToBecomeRouter()) + else if (mle.IsExpectedToBecomeRouterSoon()) { // Will check again in case the device decides to stay REED when jitter timeout expires. UpdateRegistrationDelay(mle.GetRouterSelectionJitterTimeout() + kNewRouterRegistrationDelay + 1); @@ -435,7 +435,7 @@ void DuaManager::PerformNextRegistration(void) // Only send DUA.req when necessary #if OPENTHREAD_CONFIG_DUA_ENABLE #if OPENTHREAD_FTD - VerifyOrExit(mle.IsRouterOrLeader() || !mle.IsExpectedToBecomeRouter(), error = kErrorInvalidState); + VerifyOrExit(mle.IsRouterOrLeader() || !mle.IsExpectedToBecomeRouterSoon(), error = kErrorInvalidState); #endif VerifyOrExit(mle.IsFullThreadDevice() || mle.GetParent().IsThreadVersion1p1(), error = kErrorInvalidState); #endif // OPENTHREAD_CONFIG_DUA_ENABLE diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index c9b09e8bc..2b4453405 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3698,10 +3698,13 @@ exit: InformPreviousChannel(); } -bool MleRouter::IsExpectedToBecomeRouter(void) const +bool MleRouter::IsExpectedToBecomeRouterSoon(void) const { + static constexpr uint8_t kMaxDelay = 10; + return IsRouterEligible() && IsChild() && !mAddressSolicitRejected && - (GetRouterSelectionJitterTimeout() != 0 || mAddressSolicitPending); + ((GetRouterSelectionJitterTimeout() != 0 && GetRouterSelectionJitterTimeout() <= kMaxDelay) || + mAddressSolicitPending); } void MleRouter::HandleAddressSolicit(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) diff --git a/src/core/thread/mle_router.hpp b/src/core/thread/mle_router.hpp index 2ee108097..3d4ee70e9 100644 --- a/src/core/thread/mle_router.hpp +++ b/src/core/thread/mle_router.hpp @@ -327,11 +327,11 @@ public: /** * This method returns if the REED is expected to become Router soon. * - * @retval TRUE If the REED is going to become Router. - * @retval FALSE Otherwise. + * @retval TRUE If the REED is going to become a Router soon. + * @retval FALSE If the REED is not going to become a Router soon. * */ - bool IsExpectedToBecomeRouter(void) const; + bool IsExpectedToBecomeRouterSoon(void) const; /** * This method removes a link to a neighbor. diff --git a/src/core/thread/network_data_local.cpp b/src/core/thread/network_data_local.cpp index 88a1cb5eb..78a8918da 100644 --- a/src/core/thread/network_data_local.cpp +++ b/src/core/thread/network_data_local.cpp @@ -402,13 +402,11 @@ Error Local::UpdateInconsistentServerData(Coap::ResponseHandler aHandler, void * bool isConsistent = true; #if OPENTHREAD_FTD - // Don't send this Server Data Notification if the device is going to upgrade to Router - if (Get().IsExpectedToBecomeRouter()) + if (Get().IsExpectedToBecomeRouterSoon()) { ExitNow(error = kErrorInvalidState); } - #endif UpdateRloc();