Merge pull request #1215 from joakimeriksson/rpl-child-locking

Move locking of neighbors / children from RPL to uip-ds6-route module
This commit is contained in:
Adam Dunkels 2015-09-02 19:42:45 +02:00
commit 92c1a68b94
5 changed files with 54 additions and 12 deletions

View file

@ -367,6 +367,9 @@ uip_ds6_route_add(uip_ipaddr_t *ipaddr, uint8_t length,
num_routes++;
PRINTF("uip_ds6_route_add num %d\n", num_routes);
/* lock this entry so that nexthop is not removed */
nbr_table_lock(nbr_routes, routes);
}
uip_ipaddr_copy(&(r->ipaddr), ipaddr);
@ -423,7 +426,7 @@ uip_ds6_route_rm(uip_ds6_route_t *route)
list_remove(route->neighbor_routes->route_list, neighbor_route);
if(list_head(route->neighbor_routes->route_list) == NULL) {
/* If this was the only route using this neighbor, remove the
neibhor from the table */
neighbor from the table - this implicitly unlocks nexthop */
PRINTF("uip_ds6_route_rm: removing neighbor too\n");
nbr_table_remove(nbr_routes, route->neighbor_routes->route_list);
}