diff --git a/core/net/ipv6/uip-ds6-route.c b/core/net/ipv6/uip-ds6-route.c index ecb7d354b..73a4ce9fa 100644 --- a/core/net/ipv6/uip-ds6-route.c +++ b/core/net/ipv6/uip-ds6-route.c @@ -269,9 +269,16 @@ uip_ds6_route_add(uip_ipaddr_t *ipaddr, uint8_t length, one first. */ r = uip_ds6_route_lookup(ipaddr); if(r != NULL) { + uip_ipaddr_t *current_nexthop; + current_nexthop = uip_ds6_route_nexthop(r); + if(uip_ipaddr_cmp(nexthop, current_nexthop)) { + /* no need to update route - already correct! */ + return r; + } PRINTF("uip_ds6_route_add: old route for "); PRINT6ADDR(ipaddr); PRINTF(" found, deleting it\n"); + uip_ds6_route_rm(r); } {