Skip to content

Commit

Permalink
Wi-sun bootstarp update nad balck list trace level update
Browse files Browse the repository at this point in the history
Wi-sun EAPOL parent select may fail if device neighbour entry create fail and now we remove current parent and select next one.

Change-Id: I317ff92686b2cf1ce00338bb14ad57cd7f01d96c
  • Loading branch information
Juha Heiskanen committed Dec 10, 2019
1 parent 6919ba1 commit 81740b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,7 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)

tr_debug("analyze network discovery result");

select_best_candidate:
selected_parent_ptr = ws_bootstrap_candidate_parent_get_best(cur);

if (!selected_parent_ptr) {
Expand All @@ -2851,7 +2852,13 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
ws_bootstrap_fhss_activate(cur);
llc_neighbour_req_t neighbor_info;
if (!ws_bootstrap_neighbor_info_request(cur, selected_parent_ptr->addr, &neighbor_info, true)) {
return;
//Remove Neighbour and set Link setup back
ns_list_remove(&cur->ws_info->parent_list_reserved, selected_parent_ptr);
ns_list_add_to_end(&cur->ws_info->parent_list_free, selected_parent_ptr);
// Configure LLC for network discovery
ws_bootstrap_network_discovery_configure(cur);
ws_bootstrap_fhss_activate(cur);
goto select_best_candidate;
}

ws_neighbor_class_neighbor_unicast_time_info_update(neighbor_info.ws_neighbor, &selected_parent_ptr->ws_utt, selected_parent_ptr->timestamp);
Expand Down
8 changes: 4 additions & 4 deletions source/Service_Libs/blacklist/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool blacklist_reject(const uint8_t *ll64_address)
if (blacklist_entry) {
// If address is blacklisted rejects
if (blacklist_entry->ttl > blacklist_data->blacklist_entry_lifetime) {
tr_debug("blacklist reject: %s", trace_array(ll64_address + 8, 8));
tr_info("blacklist reject: %s", trace_array(ll64_address + 8, 8));
return true;
// Neighbor heard; updates blacklist entry TTL to full lifetime
} else {
Expand Down Expand Up @@ -131,7 +131,7 @@ void blacklist_update(const uint8_t *ll64_address, bool success)
// On successful link establishment remove address from blacklist
if (success) {
if (blacklist_entry) {
tr_debug("Blacklist removed");
tr_info("Blacklist removed");
blacklist_entry_free(blacklist_entry);
}
// On failure add address to blacklist or update timeout
Expand All @@ -144,7 +144,7 @@ void blacklist_update(const uint8_t *ll64_address, bool success)
/* TTL is blacklist entry lifetime + from 1.0 to 1.5 * interval */
blacklist_entry->ttl = blacklist_data->blacklist_entry_lifetime + randLIB_randomise_base(blacklist_entry->interval, 0x8000, 0xC000);
} else {
tr_debug("Blacklist add");
tr_info("Blacklist add");
blacklist_entry_add(ll64_address + 8);
}
}
Expand Down Expand Up @@ -209,7 +209,7 @@ void blacklist_ttl_update(uint16_t ticks)
if (blacklist_entry->ttl > ticks) {
blacklist_entry->ttl -= ticks;
} else {
tr_debug("Blacklist remove entry: %s", trace_array(blacklist_entry->eui64, 8));
tr_info("Blacklist remove entry: %s", trace_array(blacklist_entry->eui64, 8));
blacklist_entry_free(blacklist_entry);
}
}
Expand Down

0 comments on commit 81740b8

Please sign in to comment.