From 6e9fb76647c846fd7e4b55c6a39e6c45b204da0f Mon Sep 17 00:00:00 2001 From: Handa Wang Date: Thu, 3 Jul 2025 03:19:05 +0800 Subject: [PATCH] [nat64] schedule evaluation of policy when `Nat64PrefixManager::Discover()` fails (#11654) Previously we were relying on the platform to call `otPlatInfraIfDiscoverNat64PrefixDone` to trigger the evaluation of NAT64 prefix. Since https://github.com/openthread/openthread/pull/11481, we're no longer doing proactive DNS-based prefix discoveries and it never calls the callback `otPlatInfraIfDiscoverNat64PrefixDone`. That means NAT64 evaluation can only happen when `RoutingManager::EvaluateRoutingPolicy` is triggered, which can cause a at most 3-minute delay (`kRaBeaconInterval`), between enabling NAT64 feature and the feature starts to work. This commit triggers the evaluation of routing policy when `Nat64PrefixManager::Discover()` fails to ensure the feature starts to work on time. --- src/core/border_router/routing_manager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index e066fdd66..71e728a1d 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -4145,6 +4145,7 @@ void RoutingManager::Nat64PrefixManager::Discover(void) else { LogWarn("Failed to discover infraif NAT64 prefix: %s", ErrorToString(error)); + Get().ScheduleRoutingPolicyEvaluation(kAfterRandomDelay); } }