[routing-manager] ensure correct handling of shorter PD prefix (#10145)

This commit corrects the order of calls to prefix methods `Tidy()` and
`SetLength(kOmrPrefixLength)`. This was unintentionally reversed in
PR #10000.

PD prefixes can be shorter than `kOmrPrefixLength` (as allowed by
`IsValidPdPrefix()`). To use them as OMR prefixes, `Tidy()` is called
first to clear any extra bits before potentially extending the prefix
to `kOmrPrefixLength`.
This commit is contained in:
Abtin Keshavarzian
2024-05-06 12:18:06 -07:00
committed by GitHub
parent 973e657c6b
commit 42ccf281fb
+1 -1
View File
@@ -3775,8 +3775,8 @@ bool RoutingManager::PdPrefixManager::ProcessPrefixEntry(DiscoveredPrefixTable::
ExitNow();
}
aEntry.mPrefix.SetLength(kOmrPrefixLength);
aEntry.mPrefix.Tidy();
aEntry.mPrefix.SetLength(kOmrPrefixLength);
// Check if there is an update to the current prefix. The valid or
// preferred lifetime may have changed.