mirror of
https://github.com/espressif/openthread.git
synced 2026-10-01 21:37:39 +00:00
[routing-manager] allow old deprecating PIOs when checking RA is from router (#8193)
This commit updates `IsReceivedRouterAdvertFromManager()` which checks if a received RA message was prepared by the `RoutingManager module itself to allow deprecating PIOs in the RA message. These will handle the case when old on-link prefix(es) (e.g., on extended PAN ID change) are being deprecated.
This commit is contained in:
@@ -810,14 +810,19 @@ bool RoutingManager::IsReceivedRouterAdvertFromManager(const Ip6::Nd::RouterAdve
|
|||||||
{
|
{
|
||||||
case Ip6::Nd::Option::kTypePrefixInfo:
|
case Ip6::Nd::Option::kTypePrefixInfo:
|
||||||
{
|
{
|
||||||
// PIO should match `mLocalOnLinkPrefix`.
|
|
||||||
|
|
||||||
const Ip6::Nd::PrefixInfoOption &pio = static_cast<const Ip6::Nd::PrefixInfoOption &>(option);
|
const Ip6::Nd::PrefixInfoOption &pio = static_cast<const Ip6::Nd::PrefixInfoOption &>(option);
|
||||||
|
|
||||||
VerifyOrExit(pio.IsValid());
|
VerifyOrExit(pio.IsValid());
|
||||||
pio.GetPrefix(prefix);
|
pio.GetPrefix(prefix);
|
||||||
|
|
||||||
VerifyOrExit(prefix == mLocalOnLinkPrefix.GetPrefix());
|
// If it is a non-deprecated PIO, it should match the
|
||||||
|
// local on-link prefix.
|
||||||
|
|
||||||
|
if (pio.GetPreferredLifetime() > 0)
|
||||||
|
{
|
||||||
|
VerifyOrExit(prefix == mLocalOnLinkPrefix.GetPrefix());
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user