[network-data] deregister stale network data when receiving packet destined to ALOC (#4485)

This commit assists the previous commit to help to remove invalid
server entry in some extreme scenario, for example if child server
switches parent in a Thread Network with packet loss, and
  a) SRV_DATA.ntf from the old parent to deregister fails
  b) the first attempt of SRV_DATA.ntf from the child fails
When the child tries to resend SRV_DATA.ntf due to network data inconsistence,
there will be no old rloc16, that is, the network data may have invalid server entry.

Though previous commit introduces the invalid child server detection when there is
new network data, however if the deregister there fails and there is no new
network data further, there is chance there invalid server entry would
stick there.
Here provides one invalid child server detection and recover mechanism
according to the ALOC destined traffic.
This commit is contained in:
Rongli Sun
2020-02-24 13:13:01 -08:00
committed by Jonathan Hui
parent b2a845947e
commit 8d9655a282
+5
View File
@@ -3821,6 +3821,11 @@ otError MleRouter::CheckReachability(uint16_t aMeshSource, uint16_t aMeshDest, I
{
ExitNow();
}
else if (IsAnycastLocator(aIp6Header.GetDestination()))
{
// Proactively notify Leader of the expired child to de-register the stale service if any.
Get<NetworkData::Leader>().SendServerDataNotification(aMeshDest);
}
}
else if (GetNextHop(aMeshDest) != Mac::kShortAddrInvalid)
{