mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 09:59:52 +00:00
[bbr] handle case where no PBBR exists in network data (#6165)
This commit is contained in:
@@ -180,7 +180,7 @@ void Leader::UpdateBackboneRouterPrimary(void)
|
||||
State state;
|
||||
uint32_t origMlrTimeout;
|
||||
|
||||
IgnoreError(Get<NetworkData::Service::Manager>().GetBackboneRouterPrimary(config));
|
||||
Get<NetworkData::Service::Manager>().GetBackboneRouterPrimary(config);
|
||||
|
||||
if (config.mServer16 != mConfig.mServer16)
|
||||
{
|
||||
|
||||
@@ -83,17 +83,18 @@ otError Manager::GetServiceId(uint8_t aServiceNumber, bool aServerStable, uint8_
|
||||
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
|
||||
otError Manager::GetBackboneRouterPrimary(ot::BackboneRouter::BackboneRouterConfig &aConfig) const
|
||||
void Manager::GetBackboneRouterPrimary(ot::BackboneRouter::BackboneRouterConfig &aConfig) const
|
||||
{
|
||||
otError error = OT_ERROR_NOT_FOUND;
|
||||
const uint8_t serviceData = BackboneRouter::kServiceNumber;
|
||||
const ServerTlv * rvalServerTlv = nullptr;
|
||||
const BackboneRouter::ServerData *rvalServerData = nullptr;
|
||||
Iterator iterator;
|
||||
|
||||
aConfig.mServer16 = Mac::kShortAddrInvalid;
|
||||
|
||||
iterator.mServiceTlv = Get<Leader>().FindService(kThreadEnterpriseNumber, &serviceData, sizeof(serviceData));
|
||||
|
||||
VerifyOrExit(iterator.mServiceTlv != nullptr, aConfig.mServer16 = Mac::kShortAddrInvalid);
|
||||
VerifyOrExit(iterator.mServiceTlv != nullptr);
|
||||
|
||||
while (IterateToNextServer(iterator) == OT_ERROR_NONE)
|
||||
{
|
||||
@@ -125,10 +126,8 @@ otError Manager::GetBackboneRouterPrimary(ot::BackboneRouter::BackboneRouterConf
|
||||
aConfig.mReregistrationDelay = rvalServerData->GetReregistrationDelay();
|
||||
aConfig.mMlrTimeout = rvalServerData->GetMlrTimeout();
|
||||
|
||||
error = OT_ERROR_NONE;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif // (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
|
||||
@@ -323,11 +323,8 @@ public:
|
||||
*
|
||||
* @param[out] aConfig The Primary Backbone Router configuration.
|
||||
*
|
||||
* @retval OT_ERROR_NONE Successfully got the Primary Backbone Router configuration.
|
||||
* @retval OT_ERROR_NOT_FOUND No Backbone Router Service in the Thread Network.
|
||||
*
|
||||
*/
|
||||
otError GetBackboneRouterPrimary(ot::BackboneRouter::BackboneRouterConfig &aConfig) const;
|
||||
void GetBackboneRouterPrimary(ot::BackboneRouter::BackboneRouterConfig &aConfig) const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user