Skip to content

Commit

Permalink
Fix Child NUD with long ARO registrations
Browse files Browse the repository at this point in the history
NUD was not sent to children if they had long ARO registrations
This should affect interoperability with devices that dont use
ARO as keep alive
  • Loading branch information
Mika Tervonen authored and Mika Tervonen committed Apr 14, 2021
1 parent 20b49ce commit 01b1188
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions source/6LoWPAN/ws/ws_bootstrap.c
Expand Up @@ -2191,6 +2191,8 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
uint8_t ll_address[16];
bool nud_proces = false;
bool activate_nud = false;
bool child;
bool candidate_parent;
protocol_interface_info_entry_t *cur = user_data;

ws_neighbor_class_entry_t *ws_neighbor = ws_neighbor_class_entry_get(&cur->ws_info->neighbor_storage, entry_ptr->index);
Expand All @@ -2204,12 +2206,17 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,

if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT) {

child = ipv6_neighbour_has_registered_by_eui64(&cur->ipv6_neighbour_cache, entry_ptr->mac64);
candidate_parent = rpl_control_is_dodag_parent_candidate(cur, ll_address, cur->ws_info->cfg->gen.rpl_parent_candidate_max);
/* For parents ARO registration is sent in link timeout times
* For candidate parents NUD is needed
* For children NUD is sent only at very close to end
*/
if (ipv6_neighbour_has_registered_by_eui64(&cur->ipv6_neighbour_cache, entry_ptr->mac64) &&
(time_from_start < WS_NEIGHBOR_NUD_TIMEOUT * 1.8)) {
if (!child && !candidate_parent) {
// No need for keep alive
return false;
}
if (child && (time_from_start < WS_NEIGHBOR_NUD_TIMEOUT * 1.8)) {
/* This is our child with valid ARO registration send NUD if we are close to delete
*
* if ARO was received link is considered active so this is only in case of very long ARO registration times
Expand All @@ -2220,11 +2227,6 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
return false;
}

if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, cur->ws_info->cfg->gen.rpl_parent_candidate_max)) {
//NUD Not needed for if neighbour is not parent candidate
return false;
}

if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT * 1.5) {
activate_nud = true;
} else {
Expand Down

0 comments on commit 01b1188

Please sign in to comment.