mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 23:57:47 +00:00
[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user