[dua] fix 1.2 compile issue without DUA flag (#5325)

This commit is contained in:
Rongli Sun
2020-08-03 08:35:42 -07:00
committed by GitHub
parent 3b6eb7de42
commit b2f7414dac
+8 -9
View File
@@ -89,8 +89,6 @@ DuaManager::DuaManager(Instance &aInstance)
void DuaManager::HandleDomainPrefixUpdate(BackboneRouter::Leader::DomainPrefixState aState)
{
const Ip6::Prefix *prefix = nullptr;
if ((aState == BackboneRouter::Leader::kDomainPrefixRemoved) ||
(aState == BackboneRouter::Leader::kDomainPrefixRefreshed))
{
@@ -123,17 +121,18 @@ void DuaManager::HandleDomainPrefixUpdate(BackboneRouter::Leader::DomainPrefixSt
// fall through
case BackboneRouter::Leader::kDomainPrefixRefreshed:
case BackboneRouter::Leader::kDomainPrefixAdded:
prefix = Get<BackboneRouter::Leader>().GetDomainPrefix();
{
const Ip6::Prefix *prefix = Get<BackboneRouter::Leader>().GetDomainPrefix();
OT_ASSERT(prefix != nullptr);
break;
mDomainUnicastAddress.mPrefixLength = prefix->GetLength();
mDomainUnicastAddress.GetAddress().Clear();
mDomainUnicastAddress.GetAddress().SetPrefix(*prefix);
}
break;
default:
ExitNow();
}
mDomainUnicastAddress.mPrefixLength = prefix->GetLength();
mDomainUnicastAddress.GetAddress().Clear();
mDomainUnicastAddress.GetAddress().SetPrefix(*prefix);
// Apply cached DUA Interface Identifier manually specified.
if (IsFixedDuaInterfaceIdentifierSet())
{
@@ -145,10 +144,10 @@ void DuaManager::HandleDomainPrefixUpdate(BackboneRouter::Leader::DomainPrefixSt
}
AddDomainUnicastAddress();
#endif
exit:
return;
#endif
}
#if OPENTHREAD_CONFIG_DUA_ENABLE