@@ -2191,6 +2191,8 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
21912191 uint8_t ll_address [16 ];
21922192 bool nud_proces = false;
21932193 bool activate_nud = false;
2194+ bool child ;
2195+ bool candidate_parent ;
21942196 protocol_interface_info_entry_t * cur = user_data ;
21952197
21962198 ws_neighbor_class_entry_t * ws_neighbor = ws_neighbor_class_entry_get (& cur -> ws_info -> neighbor_storage , entry_ptr -> index );
@@ -2204,12 +2206,17 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
22042206
22052207 if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT ) {
22062208
2209+ child = ipv6_neighbour_has_registered_by_eui64 (& cur -> ipv6_neighbour_cache , entry_ptr -> mac64 );
2210+ candidate_parent = rpl_control_is_dodag_parent_candidate (cur , ll_address , cur -> ws_info -> cfg -> gen .rpl_parent_candidate_max );
22072211 /* For parents ARO registration is sent in link timeout times
22082212 * For candidate parents NUD is needed
22092213 * For children NUD is sent only at very close to end
22102214 */
2211- if (ipv6_neighbour_has_registered_by_eui64 (& cur -> ipv6_neighbour_cache , entry_ptr -> mac64 ) &&
2212- (time_from_start < WS_NEIGHBOR_NUD_TIMEOUT * 1.8 )) {
2215+ if (!child && !candidate_parent ) {
2216+ // No need for keep alive
2217+ return false;
2218+ }
2219+ if (child && (time_from_start < WS_NEIGHBOR_NUD_TIMEOUT * 1.8 )) {
22132220 /* This is our child with valid ARO registration send NUD if we are close to delete
22142221 *
22152222 * if ARO was received link is considered active so this is only in case of very long ARO registration times
@@ -2220,11 +2227,6 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
22202227 return false;
22212228 }
22222229
2223- if (!rpl_control_is_dodag_parent_candidate (cur , ll_address , cur -> ws_info -> cfg -> gen .rpl_parent_candidate_max )) {
2224- //NUD Not needed for if neighbour is not parent candidate
2225- return false;
2226- }
2227-
22282230 if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT * 1.5 ) {
22292231 activate_nud = true;
22302232 } else {
0 commit comments