mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 04:00:10 +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;
|
int rval = 0;
|
||||||
|
|
||||||
if (aSingletonA != aSingletonB)
|
|
||||||
{
|
|
||||||
ExitNow(rval = aSingletonB ? 1 : -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aLeaderDataA.GetWeighting() != aLeaderDataB.GetWeighting())
|
if (aLeaderDataA.GetWeighting() != aLeaderDataB.GetWeighting())
|
||||||
{
|
{
|
||||||
ExitNow(rval = aLeaderDataA.GetWeighting() > aLeaderDataB.GetWeighting() ? 1 : -1);
|
ExitNow(rval = aLeaderDataA.GetWeighting() > aLeaderDataB.GetWeighting() ? 1 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aSingletonA != aSingletonB)
|
||||||
|
{
|
||||||
|
ExitNow(rval = aSingletonB ? 1 : -1);
|
||||||
|
}
|
||||||
|
|
||||||
if (aLeaderDataA.GetPartitionId() != aLeaderDataB.GetPartitionId())
|
if (aLeaderDataA.GetPartitionId() != aLeaderDataB.GetPartitionId())
|
||||||
{
|
{
|
||||||
ExitNow(rval = aLeaderDataA.GetPartitionId() > aLeaderDataB.GetPartitionId() ? 1 : -1);
|
ExitNow(rval = aLeaderDataA.GetPartitionId() > aLeaderDataB.GetPartitionId() ? 1 : -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user