From e6cd0290907c6f720801b83d3e54b89294e1ca4b Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 3 Jun 2016 12:48:02 +0200 Subject: [PATCH] rpl_remove_routes_by_nexthop: expire routes rather than remove then directly. The routes will be removed later and No-path DAOs sent accordingly in rpl_purge_routes --- core/net/rpl/rpl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/net/rpl/rpl.c b/core/net/rpl/rpl.c index 47a3d1bcc..145ec1cd1 100644 --- a/core/net/rpl/rpl.c +++ b/core/net/rpl/rpl.c @@ -215,12 +215,10 @@ rpl_remove_routes_by_nexthop(uip_ipaddr_t *nexthop, rpl_dag_t *dag) while(r != NULL) { if(uip_ipaddr_cmp(uip_ds6_route_nexthop(r), nexthop) && - r->state.dag == dag) { - uip_ds6_route_rm(r); - r = uip_ds6_route_head(); - } else { - r = uip_ds6_route_next(r); + r->state.dag == dag) { + r->state.lifetime = 0; } + r = uip_ds6_route_next(r); } ANNOTATE("#L %u 0\n", nexthop->u8[sizeof(uip_ipaddr_t) - 1]); }