From d3a6268149ac7f537da0c6e421404367afa83db8 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 18 May 2022 09:23:29 -0700 Subject: [PATCH] [routing-manager] `PublishExternalRoute()` to return success on `kErrorAlready` (#7715) This commit changes `RoutingManager::PublishExternalRoute()` method to return `kErrorAlready` as `kErrorNone` (i.e., if the prefix to be published was previously published). This commit keeps the logging the same (i.e. we still log on `Already` error so we can see when/if this happens). --- src/core/border_router/routing_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 0d99264c9..01bbee4f8 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -565,7 +565,7 @@ Error RoutingManager::PublishExternalRoute(const Ip6::Prefix &aPrefix, RoutePref LogWarn("Failed to publish external route %s: %s", aPrefix.ToString().AsCString(), ErrorToString(error)); } - return error; + return (error == kErrorAlready) ? kErrorNone : error; } void RoutingManager::UnpublishExternalRoute(const Ip6::Prefix &aPrefix)