From da45d327c7d2a740ba7891ddcd5c51ec0ccaec96 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 22 Sep 2022 13:37:42 -0700 Subject: [PATCH] [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. --- src/core/border_router/routing_manager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 827af13ce..b80059865 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -810,14 +810,19 @@ bool RoutingManager::IsReceivedRouterAdvertFromManager(const Ip6::Nd::RouterAdve { case Ip6::Nd::Option::kTypePrefixInfo: { - // PIO should match `mLocalOnLinkPrefix`. - const Ip6::Nd::PrefixInfoOption &pio = static_cast(option); VerifyOrExit(pio.IsValid()); 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; }