mirror of
https://github.com/espressif/openthread.git
synced 2026-08-29 21:39:54 +00:00
[mle] prefer higher weight partition even if singleton (#6809)
Rules for partitions preference were updated.
This commit is contained in:
@@ -1101,16 +1101,16 @@ int MleRouter::ComparePartitions(bool aSingletonA,
|
||||
{
|
||||
int rval = 0;
|
||||
|
||||
if (aSingletonA != aSingletonB)
|
||||
{
|
||||
ExitNow(rval = aSingletonB ? 1 : -1);
|
||||
}
|
||||
|
||||
if (aLeaderDataA.GetWeighting() != aLeaderDataB.GetWeighting())
|
||||
{
|
||||
ExitNow(rval = aLeaderDataA.GetWeighting() > aLeaderDataB.GetWeighting() ? 1 : -1);
|
||||
}
|
||||
|
||||
if (aSingletonA != aSingletonB)
|
||||
{
|
||||
ExitNow(rval = aSingletonB ? 1 : -1);
|
||||
}
|
||||
|
||||
if (aLeaderDataA.GetPartitionId() != aLeaderDataB.GetPartitionId())
|
||||
{
|
||||
ExitNow(rval = aLeaderDataA.GetPartitionId() > aLeaderDataB.GetPartitionId() ? 1 : -1);
|
||||
|
||||
Reference in New Issue
Block a user