From 37268889370467c5e48e306d322472d6910ebb13 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Fri, 24 Dec 2021 12:33:48 +0800 Subject: [PATCH] [border-routing] always respond to Router Solicit with Router Advertisement (#7247) This commit fixes the bug that BR may not respond to a Router Solicit with a Router Advertisement when the BR itself is Router Soliciting. This bug may cause Vicarious Router Solicitation more likely to fail because BRs may failed to send RA for vicarious RS. --- src/core/border_router/routing_manager.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 533ec4965..6b296149c 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -956,7 +956,6 @@ void RoutingManager::HandleRouterSolicit(const Ip6::Address &aSrcAddress, OT_UNUSED_VARIABLE(aBuffer); OT_UNUSED_VARIABLE(aBufferLength); - VerifyOrExit(!IsRouterSolicitationInProgress()); otLogInfoBr("Received Router Solicitation from %s on interface %u", aSrcAddress.ToString().AsCString(), mInfraIfIndex); @@ -971,10 +970,7 @@ void RoutingManager::HandleRouterSolicit(const Ip6::Address &aSrcAddress, // Schedule Router Advertisements with random delay. randomDelay = Random::NonCrypto::GetUint32InRange(0, kMaxRaDelayTime); otLogInfoBr("Router Advertisement scheduled in %u milliseconds", randomDelay); - mRouterAdvertisementTimer.Start(randomDelay); - -exit: - return; + mRouterAdvertisementTimer.FireAtIfEarlier(TimerMilli::GetNow() + randomDelay); } uint32_t RoutingManager::ExternalPrefix::GetPrefixExpireDelay(uint32_t aValidLifetime)