@@ -1292,19 +1292,32 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
1292
1292
continue ;
1293
1293
}
1294
1294
1295
- if (ipv6_neighbour_has_registered_by_eui64 (& interface -> ipv6_neighbour_cache , cur -> mac64 )) {
1296
- // We have registered entry so we have been selected as parent
1297
- continue ;
1295
+ if (cur -> trusted_device ) {
1296
+
1297
+ if (ipv6_neighbour_has_registered_by_eui64 (& interface -> ipv6_neighbour_cache , cur -> mac64 )) {
1298
+ // We have registered entry so we have been selected as parent
1299
+ continue ;
1300
+ }
1301
+
1302
+ memcpy (ll_target + 8 , cur -> mac64 , 8 );
1303
+ ll_target [8 ] ^= 2 ;
1304
+
1305
+ if (rpl_control_is_dodag_parent (interface , ll_target )) {
1306
+ // Possible parent is limited to 3 by default?
1307
+ continue ;
1308
+ }
1298
1309
}
1299
1310
1300
- memcpy (ll_target + 8 , cur -> mac64 , 8 );
1301
- ll_target [8 ] ^= 2 ;
1302
1311
1303
- if (rpl_control_is_dodag_parent (interface , ll_target )) {
1304
- // Possible parent is limited to 3 by default?
1305
- continue ;
1312
+
1313
+ if (cur -> trusted_device ) {
1314
+ neighbor_entry_ptr = cur ;
1315
+ } else {
1316
+ if (cur -> link_lifetime - cur -> lifetime > WS_NEIGHBOR_NOT_TRUSTED_LINK_TIMEOUT ) {
1317
+ //Accept only Enough Old not trusted Device
1318
+ neighbor_entry_ptr = cur ;
1319
+ }
1306
1320
}
1307
- neighbor_entry_ptr = cur ;
1308
1321
}
1309
1322
if (neighbor_entry_ptr ) {
1310
1323
tr_info ("dropped oldest neighbour %s" , trace_array (neighbor_entry_ptr -> mac64 , 8 ));
0 commit comments