Skip to content

Commit

Permalink
[routing-manager] check mIsRunning in `ScheduleRoutingPolicyEvaluat…
Browse files Browse the repository at this point in the history
…ion()` (openthread#9594)
  • Loading branch information
abtink authored Nov 10, 2023
1 parent cd425eb commit 1723ae9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/border_router/routing_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ void RoutingManager::UpdateRioPreference(RoutePreference aPreference)
RoutePreferenceToString(aPreference));
mRioPreference = aPreference;

VerifyOrExit(mIsRunning);
ScheduleRoutingPolicyEvaluation(kAfterRandomDelay);

exit:
Expand Down Expand Up @@ -544,6 +543,8 @@ void RoutingManager::ScheduleRoutingPolicyEvaluation(ScheduleMode aMode)
uint32_t delay = 0;
TimeMilli evaluateTime;

VerifyOrExit(mIsRunning);

switch (aMode)
{
case kImmediately:
Expand Down Expand Up @@ -590,6 +591,9 @@ void RoutingManager::ScheduleRoutingPolicyEvaluation(ScheduleMode aMode)
}
}
#endif

exit:
return;
}

void RoutingManager::SendRouterAdvertisement(RouterAdvTxMode aRaTxMode)
Expand Down Expand Up @@ -3213,11 +3217,7 @@ void RoutingManager::Nat64PrefixManager::HandleDiscoverDone(const Ip6::Prefix &a
mInfraIfPrefix = aPrefix;

LogInfo("Infraif NAT64 prefix: %s", mInfraIfPrefix.IsValidNat64() ? mInfraIfPrefix.ToString().AsCString() : "none");

if (Get<RoutingManager>().mIsRunning)
{
Get<RoutingManager>().ScheduleRoutingPolicyEvaluation(kAfterRandomDelay);
}
Get<RoutingManager>().ScheduleRoutingPolicyEvaluation(kAfterRandomDelay);
}

Nat64::State RoutingManager::Nat64PrefixManager::GetState(void) const
Expand Down

0 comments on commit 1723ae9

Please sign in to comment.