From feec2e6a6d00bf615bdb031cfea0b24f06053014 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Tue, 13 Jul 2021 22:39:31 +0200 Subject: [PATCH] [mle] prefer higher weight partition even if singleton (#6809) Rules for partitions preference were updated. --- src/core/thread/mle_router.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 570e13296..e58f0c347 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -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);