[mle] skip IPv6 address registration entries with no matching context (#2604)

This commit is contained in:
Jonathan Hui
2018-03-07 20:12:55 +00:00
committed by GitHub
parent 157d74d3ef
commit c98164f933
+8 -4
View File
@@ -2091,11 +2091,17 @@ otError MleRouter::UpdateChildAddresses(const Message &aMessage, uint16_t aOffse
VerifyOrExit(aMessage.Read(offset, len, &entry) == len, error = OT_ERROR_PARSE);
offset += len;
registeredCount++;
if (entry.IsCompressed())
{
// xxx check if context id exists
GetNetif().GetNetworkDataLeader().GetContext(entry.GetContextId(), context);
if (GetNetif().GetNetworkDataLeader().GetContext(entry.GetContextId(), context) != OT_ERROR_NONE)
{
otLogWarnMle(GetInstance(), "Failed to get context %d for compressed address from child 0x%04x",
entry.GetContextId(), aChild.GetRloc16());
continue;
}
memcpy(&address, context.mPrefix, BitVectorBytes(context.mPrefixLength));
address.SetIid(entry.GetIid());
}
@@ -2104,8 +2110,6 @@ otError MleRouter::UpdateChildAddresses(const Message &aMessage, uint16_t aOffse
address = *entry.GetIp6Address();
}
registeredCount++;
// We try to accept/add as many IPv6 addresses as possible.
// "Child ID/Update Response" will indicate the accepted
// addresses.