From 9e0f4ae619509371e75b699449c0674e04de850b Mon Sep 17 00:00:00 2001 From: whd <7058128+superwhd@users.noreply.github.com> Date: Thu, 22 Dec 2022 13:14:15 +0800 Subject: [PATCH] [routing-manager] `GetFavoredOmrPrefix` should return an error when Routing Manager is not running (#8565) --- include/openthread/border_routing.h | 2 +- include/openthread/instance.h | 2 +- src/core/border_router/routing_manager.cpp | 2 +- src/core/border_router/routing_manager.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/openthread/border_routing.h b/include/openthread/border_routing.h index ba8d40ee1..4801d869e 100644 --- a/include/openthread/border_routing.h +++ b/include/openthread/border_routing.h @@ -190,7 +190,7 @@ otError otBorderRoutingGetOmrPrefix(otInstance *aInstance, otIp6Prefix *aPrefix) * @param[out] aPrefix A pointer to output the favored OMR prefix. * @param[out] aPreference A pointer to output the preference associated the favored prefix. * - * @retval OT_ERROR_INVALID_STATE The Border Routing Manager is not initialized yet. + * @retval OT_ERROR_INVALID_STATE The Border Routing Manager is not running yet. * @retval OT_ERROR_NONE Successfully retrieved the favored OMR prefix. * */ diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 34f294fe1..1a809bc19 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -53,7 +53,7 @@ extern "C" { * @note This number versions both OpenThread platform and user APIs. * */ -#define OPENTHREAD_API_VERSION (271) +#define OPENTHREAD_API_VERSION (272) /** * @addtogroup api-instance diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 00b415755..8c61f6f05 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -148,7 +148,7 @@ Error RoutingManager::GetFavoredOmrPrefix(Ip6::Prefix &aPrefix, RoutePreference { Error error = kErrorNone; - VerifyOrExit(IsInitialized(), error = kErrorInvalidState); + VerifyOrExit(IsRunning(), error = kErrorInvalidState); aPrefix = mFavoredOmrPrefix.GetPrefix(); aPreference = mFavoredOmrPrefix.GetPreference(); diff --git a/src/core/border_router/routing_manager.hpp b/src/core/border_router/routing_manager.hpp index 75fa75eba..30137ba4d 100644 --- a/src/core/border_router/routing_manager.hpp +++ b/src/core/border_router/routing_manager.hpp @@ -197,7 +197,7 @@ public: * @param[out] aPrefix A reference to output the favored prefix. * @param[out] aPreference A reference to output the preference associated with the favored OMR prefix. * - * @retval kErrorInvalidState The Border Routing Manager is not initialized yet. + * @retval kErrorInvalidState The Border Routing Manager is not running yet. * @retval kErrorNone Successfully retrieved the OMR prefix. * */