Skip to content

Commit 5e67f7c

Browse files
author
Juha Heiskanen
committed
RPL update
Fixed double age issue for route update. Minor typo fix's Change-Id: Iac93311ca9d176cf2d3f3f35a180bc336d416bb5
1 parent bbae493 commit 5e67f7c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

source/RPL/rpl_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static buffer_t *rpl_control_dio_handler(protocol_interface_info_entry_t *cur, r
992992

993993

994994
rpl_control_process_prefix_options(cur, instance, dodag, neighbour, ptr, buffer_data_end(buf));
995-
rpl_dodag_update_implicit_system_routes(dodag, neighbour);
995+
//rpl_dodag_update_implicit_system_routes(dodag, neighbour);
996996
rpl_control_process_route_options(instance, dodag, version, neighbour, rank, ptr, buffer_data_end(buf));
997997

998998
//rpl_control_process_metric_containers(neighbour, ptr, buffer_data_end(buf))

source/RPL/rpl_upward.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ static void rpl_instance_update_system_dio_route(rpl_instance_t *instance, rpl_n
12801280

12811281
uint8_t metric = ipv6_route_pref_to_metric(pref) + parent->dodag_pref;
12821282

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);
12841284
}
12851285

12861286
/* 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
12901290
return;
12911291
}
12921292

1293-
uint32_t aged_default = rpl_aged_lifetime(rpl_default_lifetime(dodag), parent->dio_timestamp);
1293+
uint32_t default_lifetime = rpl_default_lifetime(dodag);
12941294
uint8_t metric = IPV6_ROUTE_DEFAULT_METRIC + parent->dodag_pref;
12951295

12961296
/* 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);
12981298

12991299
/* 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);
13011301

13021302
}
13031303

@@ -1365,7 +1365,8 @@ void rpl_instance_run_parent_selection(rpl_instance_t *instance)
13651365
}
13661366

13671367
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)) {
13691370
rpl_delete_neighbour(instance, n);
13701371
continue;
13711372
}

source/ipv6_stack/ipv6_routing_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef enum ipv6_route_src {
7373
ROUTE_RPL_DAO, /* Explicitly advertised in DAO, Storing mode */
7474
ROUTE_RPL_DAO_SR, /* Explicitly advertised in DAO, Root Source Routes in Non-Storing mode */
7575
ROUTE_RPL_SRH, /* Not in routing table - used in buffers to represent on-link inferred from SRH */
76-
ROUTE_RPL_ROOT, /* Implicit route to DODAG route */
76+
ROUTE_RPL_ROOT, /* Implicit route to DODAG root */
7777
ROUTE_RPL_INSTANCE, /* Implicit instance-specific default upward route (not for general search) */
7878
ROUTE_RPL_FWD_ERROR, /* Not in routing table - used in buffers to represent Forwarding-Error bounce */
7979
ROUTE_MULTICAST, /* Not in routing table - used to represent multicast interface selection */

0 commit comments

Comments
 (0)