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
existing route for our destination, we'll just update the old
one. */
existing route for our destination, we'll delete the old
one first. */
r = uip_ds6_route_lookup(ipaddr);
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);
PRINTF("\n");
} else {
PRINTF(" found, deleting it\n");
uip_ds6_route_rm(r);
}
{
struct uip_ds6_route_neighbor_routes *routes;
/* 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