[routing-manager] adv local on-link prefix after added in net data (#8119)

This commit enhances `RoutingManager` so that when we decide to
advertise the local on-link prefix and publish it in Network Data as
an external route, we wait for it to be seen in the leader's Network
Data before including it in the emitted RA messages as PIO. If the
prefix is already present in Network Data (e.g., may have been added
by another BR on the same Thread mesh) we start advertising it
immediately. When publishing prefixes in Network Data, it may take a
short random time before the entry is registered with leader and the
updated Network Data is propagated to all Thread nodes. This change
delays the advertisement of the on-link prefix on the infra link side
till it is configured as an external route on the Thread side.
This commit is contained in:
Abtin Keshavarzian
2022-10-13 09:15:17 -07:00
committed by GitHub
parent f92364c977
commit f5e2a0f961
3 changed files with 126 additions and 24 deletions
+10 -3
View File
@@ -300,7 +300,7 @@ void ValidateRouterAdvert(const Icmp6Packet &aPacket)
break;
}
}
else
else if (sExpectOldOnLinkPio)
{
VerifyOrQuit(pio.GetPreferredLifetime() == 0, "Old on link prefix is not deprecated");
sOldOnLinkPrefix = prefix;
@@ -347,16 +347,23 @@ void ValidateRouterAdvert(const Icmp6Packet &aPacket)
break;
case kPioAdvertisingLocalOnLink:
case kPioDeprecatingLocalOnLink:
VerifyOrQuit(sawExpectedPio, "Did not see on-link prefix PIO in the RA");
// First emitted RAs may not yet have the expected PIO
// so we exit and not set `sRaValidated` to allow it
// to be checked for next received RA.
VerifyOrExit(sawExpectedPio);
break;
}
if (sExpectOldOnLinkPio)
{
VerifyOrQuit(sawExpecteOldPio, "Did not see old on-link prefix PIO in the RA");
VerifyOrExit(sawExpecteOldPio);
}
sRaValidated = true;
}
exit:
return;
}
void LogRouterAdvert(const Icmp6Packet &aPacket)