@@ -390,6 +390,24 @@ uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size)
390
390
}
391
391
}
392
392
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
+
393
411
uint8_t ws_common_allow_child_registration (protocol_interface_info_entry_t * interface , const uint8_t * eui64 )
394
412
{
395
413
uint8_t child_count = 0 ;
@@ -402,14 +420,7 @@ uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *inte
402
420
403
421
//Validate Is EUI64 already allocated for any address
404
422
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 );
413
424
tr_info ("Child registration from old child" );
414
425
return ARO_SUCCESS ;
415
426
}
@@ -431,7 +442,8 @@ uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *inte
431
442
tr_warn ("Child registration not allowed %d/%d, max:%d" , child_count , max_child_count , mac_neighbor_info (interface )-> list_total_size );
432
443
return ARO_FULL ;
433
444
}
434
- ws_bootstrap_neighbor_set_stable (interface , eui64 );
445
+
446
+ ws_common_neighbour_address_reg_link_update (interface , eui64 );
435
447
tr_info ("Child registration allowed %d/%d, max:%d" , child_count , max_child_count , mac_neighbor_info (interface )-> list_total_size );
436
448
return ARO_SUCCESS ;
437
449
}
0 commit comments