[dhcp6-client] update DHCPv6 service RLOC on new network data (#5169)

This commit is contained in:
Jonathan Hui
2020-07-01 16:48:27 -07:00
parent 88e2ca5714
commit a795db710f
+3 -1
View File
@@ -137,6 +137,7 @@ void Dhcp6Client::UpdateAddresses(void)
else if (MatchNetifAddressWithPrefix(mIdentityAssociations[i].mNetifAddress, config.mPrefix)) else if (MatchNetifAddressWithPrefix(mIdentityAssociations[i].mNetifAddress, config.mPrefix))
{ {
found = true; found = true;
ia = &mIdentityAssociations[i];
break; break;
} }
} }
@@ -145,7 +146,6 @@ void Dhcp6Client::UpdateAddresses(void)
{ {
if (ia != nullptr) if (ia != nullptr)
{ {
ia->mPrefixAgentRloc = config.mRloc16;
ia->mNetifAddress.mAddress = config.mPrefix.mPrefix; ia->mNetifAddress.mAddress = config.mPrefix.mPrefix;
ia->mNetifAddress.mPrefixLength = config.mPrefix.mLength; ia->mNetifAddress.mPrefixLength = config.mPrefix.mLength;
ia->mStatus = kIaStatusSolicit; ia->mStatus = kIaStatusSolicit;
@@ -157,6 +157,8 @@ void Dhcp6Client::UpdateAddresses(void)
continue; continue;
} }
} }
ia->mPrefixAgentRloc = config.mRloc16;
} }
if (doesAgentExist) if (doesAgentExist)