mirror of
https://github.com/espressif/openthread.git
synced 2026-10-23 07:58:20 +00:00
[routing-manager] use FavoredOmrPrefix::IsInfrastructureDerived() in PdPrefixManager (#11239)
This commit updates `PdPrefixManager::Evaluate()` to directly use the helper method `FavoredOmrPrefix::IsInfrastructureDerived()` when deciding to pause and change to `kDhcp6PdStateIdle`. This helps improve code readability.
This commit is contained in:
@@ -4007,9 +4007,7 @@ RoutingManager::PdPrefixManager::State RoutingManager::PdPrefixManager::GetState
|
||||
void RoutingManager::PdPrefixManager::Evaluate(void)
|
||||
{
|
||||
const FavoredOmrPrefix &favoredPrefix = Get<RoutingManager>().mOmrPrefixManager.GetFavoredPrefix();
|
||||
|
||||
bool shouldPause = !favoredPrefix.IsEmpty() && favoredPrefix.GetPrefix() != mPrefix.GetPrefix() &&
|
||||
favoredPrefix.GetPreference() >= kPdRoutePreference;
|
||||
bool shouldPause = favoredPrefix.IsInfrastructureDerived() && (favoredPrefix.GetPrefix() != mPrefix.GetPrefix());
|
||||
|
||||
PauseResume(/* aPause */ shouldPause);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user