Merge pull request #701 from tim-ist/routing_fix

Re-create a routing table entry if the next hop is changed.
This commit is contained in:
Nicolas Tsiftes 2014-06-13 14:56:56 +02:00
commit 4ce3e4dee8

View file

@ -262,14 +262,16 @@ uip_ds6_route_add(uip_ipaddr_t *ipaddr, uint8_t length,
} }
/* First make sure that we don't add a route twice. If we find an /* First make sure that we don't add a route twice. If we find an
existing route for our destination, we'll just update the old existing route for our destination, we'll delete the old
one. */ one first. */
r = uip_ds6_route_lookup(ipaddr); r = uip_ds6_route_lookup(ipaddr);
if(r != NULL) { if(r != NULL) {
PRINTF("uip_ds6_route_add: old route already found, updating this one instead: "); PRINTF("uip_ds6_route_add: old route for ");
PRINT6ADDR(ipaddr); PRINT6ADDR(ipaddr);
PRINTF("\n"); PRINTF(" found, deleting it\n");
} else { uip_ds6_route_rm(r);
}
{
struct uip_ds6_route_neighbor_routes *routes; struct uip_ds6_route_neighbor_routes *routes;
/* If there is no routing entry, create one. We first need to /* If there is no routing entry, create one. We first need to
check if we have room for this route. If not, we remove the check if we have room for this route. If not, we remove the