diff --git a/src/core/thread/network_data_leader.cpp b/src/core/thread/network_data_leader.cpp index 95d20ba6b..351ea69a7 100644 --- a/src/core/thread/network_data_leader.cpp +++ b/src/core/thread/network_data_leader.cpp @@ -296,6 +296,11 @@ int LeaderBase::CompareRouteEntries(int8_t aFirstPreference, // that the first entry is preferred over the second one. result = ThreeWayCompare(Get().GetPathCost(aSecondRloc), Get().GetPathCost(aFirstRloc)); + VerifyOrExit(result == 0); + + // If all the same, prefer the BR acting as a router over an + // end device. + result = ThreeWayCompare(Mle::IsActiveRouter(aFirstRloc), Mle::IsActiveRouter(aSecondRloc)); #endif exit: