@@ -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+
393411uint8_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