Skip to content

Commit b720fbd

Browse files
author
Juha Heiskanen
committed
Wi-SUN discovery and address registration update
Moved Neighbour table clean before clear old Pan-id and enable Neighbour cache clean. ARO registration set Stable timeout also now for old regisred cache.
1 parent e73c808 commit b720fbd

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,9 +2788,6 @@ static void ws_bootstrap_start_discovery(protocol_interface_info_entry_t *cur)
27882788
cur->ws_info->pan_timeout_timer = 0;
27892789
cur->ws_info->weakest_received_rssi = 0;
27902790

2791-
// Clear learned neighbours
2792-
ws_bootstrap_neighbor_list_clean(cur);
2793-
27942791
// Clear learned candidate parents
27952792
ws_bootstrap_candidate_table_reset(cur);
27962793

@@ -3316,7 +3313,8 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
33163313
break;
33173314
}
33183315
ws_pae_controller_supp_init(cur);
3319-
3316+
// Clear learned neighbours
3317+
ws_bootstrap_neighbor_list_clean(cur);
33203318
// Configure LLC for network discovery
33213319
ws_bootstrap_network_discovery_configure(cur);
33223320
ws_bootstrap_fhss_activate(cur);

source/6LoWPAN/ws/ws_common.c

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,24 @@ uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size)
390390
}
391391
}
392392

393+
static void ws_common_neighbour_address_reg_link_update(protocol_interface_info_entry_t *interface, const uint8_t *eui64)
394+
{
395+
/*
396+
* ARO registration from child can update the link timeout so we don't need to send extra NUD if ARO received
397+
*/
398+
mac_neighbor_table_entry_t *mac_neighbor = mac_neighbor_entry_get_by_mac64(mac_neighbor_info(interface), eui64, false, false);
399+
400+
if (mac_neighbor) {
401+
if (mac_neighbor->link_lifetime != WS_NEIGHBOR_LINK_TIMEOUT) {
402+
//Set Stable timeout for temporary entry here
403+
mac_neighbor->link_lifetime = WS_NEIGHBOR_LINK_TIMEOUT;
404+
tr_info("Added new neighbor %s : index:%u", trace_array(eui64, 8), mac_neighbor->index);
405+
}
406+
//Refresh
407+
mac_neighbor->lifetime = mac_neighbor->link_lifetime;
408+
}
409+
}
410+
393411
uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *interface, const uint8_t *eui64)
394412
{
395413
uint8_t child_count = 0;
@@ -402,14 +420,7 @@ uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *inte
402420

403421
//Validate Is EUI64 already allocated for any address
404422
if (ipv6_neighbour_has_registered_by_eui64(&interface->ipv6_neighbour_cache, eui64)) {
405-
/*
406-
* ARO registration from child can update the link timeout so we don't need to send extra NUD if ARO received
407-
*/
408-
mac_neighbor_table_entry_t *mac_neighbor = mac_neighbor_entry_get_by_mac64(mac_neighbor_info(interface), eui64, false, false);
409-
410-
if (mac_neighbor) {
411-
mac_neighbor_table_neighbor_refresh(mac_neighbor_info(interface), mac_neighbor, mac_neighbor->link_lifetime);
412-
}
423+
ws_common_neighbour_address_reg_link_update(interface, eui64);
413424
tr_info("Child registration from old child");
414425
return ARO_SUCCESS;
415426
}
@@ -431,7 +442,8 @@ uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *inte
431442
tr_warn("Child registration not allowed %d/%d, max:%d", child_count, max_child_count, mac_neighbor_info(interface)->list_total_size);
432443
return ARO_FULL;
433444
}
434-
ws_bootstrap_neighbor_set_stable(interface, eui64);
445+
446+
ws_common_neighbour_address_reg_link_update(interface, eui64);
435447
tr_info("Child registration allowed %d/%d, max:%d", child_count, max_child_count, mac_neighbor_info(interface)->list_total_size);
436448
return ARO_SUCCESS;
437449
}

0 commit comments

Comments
 (0)