Skip to content

Commit 32cfb6b

Browse files
Fix to partition selection rules (#1633)
Fix the partition selection rule for the weight to enable merging when the heard partition weight is higher.
1 parent 0d655ed commit 32cfb6b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,14 @@ int thread_bootstrap_partition_process(protocol_interface_info_entry_t *cur, uin
333333
/*Rule 0: If we are going to form Higher partition than heard we dont try to attach to lower ones
334334
*/
335335
if (thread_extension_enabled(cur) &&
336-
thread_info(cur)->thread_device_mode == THREAD_DEVICE_MODE_ROUTER &&
337-
heard_partition_leader_data->weighting < thread_info(cur)->partition_weighting) {
338-
return -2;
336+
thread_info(cur)->thread_device_mode == THREAD_DEVICE_MODE_ROUTER) {
337+
if (heard_partition_leader_data->weighting < thread_info(cur)->partition_weighting) {
338+
tr_debug("Heard a lower weight partition");
339+
return -2;
340+
}
341+
if (heard_partition_leader_data->weighting > thread_info(cur)->partition_weighting) {
342+
return 2;
343+
}
339344
}
340345

341346
//Rule 1: A non-singleton Thread Network Partition always has higher priority than a singleton Thread Network Partition

0 commit comments

Comments
 (0)