From 125e72688b8baf433db06401f434e75222f7c6bd Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 6 Mar 2024 11:23:08 -0800 Subject: [PATCH] [routing-manager] delay sending RAs until after initial policy evaluation (#9896) This commit modifies the `RoutingManager` to not send any Router Advertisements (RAs) until the initial policy evaluation has completed. This change leverages the `IsInitialPolicyEvaluationDone()` method which ensures that both OMR and on-link prefixes have been determined. Specifically, this guarantees that we wait for the initial set of Router Solicitation (RS) messages to be sent and that we discover all other routers on the AIL before sending the first RA. This is because on-link prefix evaluation itself is dependent on the `mRsSender.IsInProgress()` check that waits till all RS messages are sent and RAs from other routers are received and processed. Without this change, the BR could receive its own RS message, triggering it to send an RA prematurely, potentially with incorrect M and O flags. --- src/core/border_router/routing_manager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 81f2d9abb..9e053d6a6 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -478,7 +478,10 @@ void RoutingManager::EvaluateRoutingPolicy(void) mNat64PrefixManager.Evaluate(); #endif - SendRouterAdvertisement(kAdvPrefixesFromNetData); + if (IsInitalPolicyEvaluationDone()) + { + SendRouterAdvertisement(kAdvPrefixesFromNetData); + } #if OPENTHREAD_CONFIG_SRP_SERVER_ENABLE if (Get().IsAutoEnableMode() && IsInitalPolicyEvaluationDone())