@@ -249,25 +249,6 @@ static bool thread_heard_lower_partition(protocol_interface_info_entry_t *cur, t
249
249
return false;
250
250
}
251
251
252
- static bool thread_reed_partitions_merge (protocol_interface_info_entry_t * cur , uint16_t shortAddress , thread_leader_data_t heard_partition_leader_data )
253
- {
254
- if (thread_is_router_addr (shortAddress )) {
255
- return false;
256
- }
257
- // lower weighting heard
258
- if (thread_info (cur )-> thread_leader_data -> weighting > heard_partition_leader_data .weighting ) {
259
- return false;
260
- }
261
- // lower/same partition id heard
262
- if (thread_info (cur )-> thread_leader_data -> weighting == heard_partition_leader_data .weighting &&
263
- thread_info (cur )-> thread_leader_data -> partitionId >= heard_partition_leader_data .partitionId ) {
264
- return false;
265
- }
266
- // can merge to a higher weighting/partition id
267
- thread_bootstrap_connection_error (cur -> id , CON_ERROR_PARTITION_MERGE , NULL );
268
- return true;
269
- }
270
-
271
252
static bool thread_router_advertiment_tlv_analyze (uint8_t * ptr , uint16_t data_length , thread_leader_data_t * leaderData , uint16_t * shortAddress , mle_tlv_info_t * routeTlv )
272
253
{
273
254
//Read Leader Data and verify connectivity
@@ -401,10 +382,13 @@ static void thread_parse_advertisement(protocol_interface_info_entry_t *cur, mle
401
382
}
402
383
/* Advertisement from higher / lower partition */
403
384
} else {
404
- // process REED advertisement from higher partition
405
- if (thread_reed_partitions_merge (cur , shortAddress , leaderData )) {
385
+ // Check if better partition is heard
386
+ if (thread_bootstrap_partition_process (cur , thread_get_router_count_from_route_tlv (& routeTlv ), & leaderData , & routeTlv ) > 0 ) {
387
+ tr_debug ("Start Merge" );
388
+ thread_bootstrap_connection_error (cur -> id , CON_ERROR_PARTITION_MERGE , NULL );
406
389
return ;
407
390
}
391
+
408
392
// REED advertisement to lower partition to help merge faster
409
393
if (thread_heard_lower_partition (cur ,leaderData )) {
410
394
thread_router_bootstrap_reed_merge_advertisement (cur );
0 commit comments