Skip to content

Commit be3c94e

Browse files
author
Juha Heiskanen
committed
WS RPL paret soft filter update
Removed bootstrap active check Selected parent will also check if there is more than selected candidates before drop.
1 parent 8b1d537 commit be3c94e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,19 +2381,21 @@ static void ws_rpl_prefix_callback(prefix_entry_t *prefix, void *handle, uint8_t
23812381

23822382
static bool ws_rpl_candidate_soft_filtering(protocol_interface_info_entry_t *cur, struct rpl_instance *instance)
23832383
{
2384-
//If bootstrap active we not need any candidate filtering
2385-
if ((cur->lowpan_info & INTERFACE_NWK_BOOTSRAP_ACTIVE) && (ws_info(cur)->cfg->gen.network_size == NETWORK_SIZE_CERTIFICATE)) {
2386-
return true;
2387-
}
2388-
23892384
//Already many candidates
2390-
if (rpl_control_candidate_list_size(cur, instance) > cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
2385+
uint16_t candidate_list_size = rpl_control_candidate_list_size(cur, instance);
2386+
if (candidate_list_size > cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
23912387
return false;
23922388
}
23932389

2390+
uint16_t selected_parents = rpl_control_selected_parent_count(cur, instance);
2391+
23942392
//Already enough selected candidates
2395-
if (rpl_control_selected_parent_count(cur, instance) >= cur->ws_info->cfg->gen.rpl_selected_parent_max) {
2396-
return false;
2393+
if (selected_parents >= cur->ws_info->cfg->gen.rpl_selected_parent_max) {
2394+
candidate_list_size -= selected_parents;
2395+
if (candidate_list_size >= 2) {
2396+
//We have more candidates than selected
2397+
return false;
2398+
}
23972399
}
23982400

23992401
return true;

0 commit comments

Comments
 (0)