@@ -1280,7 +1280,7 @@ static void rpl_instance_update_system_dio_route(rpl_instance_t *instance, rpl_n
1280
1280
1281
1281
uint8_t metric = ipv6_route_pref_to_metric (pref ) + parent -> dodag_pref ;
1282
1282
1283
- ipv6_route_add_metric (route -> prefix , route -> prefix_len , parent -> interface_id , parent -> ll_address , ROUTE_RPL_DIO , parent , instance -> id , rpl_aged_lifetime ( route -> lifetime , parent -> dio_timestamp ) , metric );
1283
+ ipv6_route_add_metric (route -> prefix , route -> prefix_len , parent -> interface_id , parent -> ll_address , ROUTE_RPL_DIO , parent , instance -> id , route -> lifetime , metric );
1284
1284
}
1285
1285
1286
1286
/* Called when a DIO has been received */
@@ -1290,14 +1290,14 @@ void rpl_dodag_update_implicit_system_routes(rpl_dodag_t *dodag, rpl_neighbour_t
1290
1290
return ;
1291
1291
}
1292
1292
1293
- uint32_t aged_default = rpl_aged_lifetime ( rpl_default_lifetime (dodag ), parent -> dio_timestamp );
1293
+ uint32_t default_lifetime = rpl_default_lifetime (dodag );
1294
1294
uint8_t metric = IPV6_ROUTE_DEFAULT_METRIC + parent -> dodag_pref ;
1295
1295
1296
1296
/* Always add the "root" default route - only used for per-instance lookup */
1297
- ipv6_route_add_metric (NULL , 0 , parent -> interface_id , parent -> ll_address , ROUTE_RPL_INSTANCE , parent , dodag -> instance -> id , aged_default , metric );
1297
+ ipv6_route_add_metric (NULL , 0 , parent -> interface_id , parent -> ll_address , ROUTE_RPL_INSTANCE , parent , dodag -> instance -> id , default_lifetime , metric );
1298
1298
1299
1299
/* Also add a specific route to the DODAGID */
1300
- ipv6_route_add_metric (dodag -> id , 128 , parent -> interface_id , parent -> ll_address , ROUTE_RPL_ROOT , parent , dodag -> instance -> id , aged_default , metric );
1300
+ ipv6_route_add_metric (dodag -> id , 128 , parent -> interface_id , parent -> ll_address , ROUTE_RPL_ROOT , parent , dodag -> instance -> id , default_lifetime , metric );
1301
1301
1302
1302
}
1303
1303
@@ -1365,7 +1365,8 @@ void rpl_instance_run_parent_selection(rpl_instance_t *instance)
1365
1365
}
1366
1366
1367
1367
ns_list_foreach_safe (rpl_neighbour_t , n , & instance -> candidate_neighbours ) {
1368
- if (rpl_aged_lifetime (rpl_default_lifetime (n -> dodag_version -> dodag ), n -> dio_timestamp ) == 0 ) {
1368
+ //Remove a Parent candidates which are not heared a long time ago and not slected ones
1369
+ if (!n -> dodag_parent && (rpl_aged_lifetime (rpl_default_lifetime (n -> dodag_version -> dodag ), n -> dio_timestamp ) == 0 )) {
1369
1370
rpl_delete_neighbour (instance , n );
1370
1371
continue ;
1371
1372
}
0 commit comments