From 1723ae9d71be790f87c39b376605f6130140e518 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 10 Nov 2023 09:48:16 -0800 Subject: [PATCH] [routing-manager] check `mIsRunning` in `ScheduleRoutingPolicyEvaluation()` (#9594) --- src/core/border_router/routing_manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 2af95e2bc36..e5cd61da9b7 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -186,7 +186,6 @@ void RoutingManager::UpdateRioPreference(RoutePreference aPreference) RoutePreferenceToString(aPreference)); mRioPreference = aPreference; - VerifyOrExit(mIsRunning); ScheduleRoutingPolicyEvaluation(kAfterRandomDelay); exit: @@ -544,6 +543,8 @@ void RoutingManager::ScheduleRoutingPolicyEvaluation(ScheduleMode aMode) uint32_t delay = 0; TimeMilli evaluateTime; + VerifyOrExit(mIsRunning); + switch (aMode) { case kImmediately: @@ -590,6 +591,9 @@ void RoutingManager::ScheduleRoutingPolicyEvaluation(ScheduleMode aMode) } } #endif + +exit: + return; } void RoutingManager::SendRouterAdvertisement(RouterAdvTxMode aRaTxMode) @@ -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().mIsRunning) - { - Get().ScheduleRoutingPolicyEvaluation(kAfterRandomDelay); - } + Get().ScheduleRoutingPolicyEvaluation(kAfterRandomDelay); } Nat64::State RoutingManager::Nat64PrefixManager::GetState(void) const