Commit 23c769c5 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use struct destination in find_route.

parent 900f7e11
......@@ -42,12 +42,11 @@ int route_timeout_delay = 50;
int route_gc_delay = 95;
struct route *
find_route(const unsigned char *dest, struct neighbour *nexthop)
find_route(struct destination *dest, struct neighbour *nexthop)
{
int i;
for(i = 0; i < numroutes; i++) {
if(routes[i].nexthop == nexthop &&
memcmp(routes[i].dest->address, dest, 16) == 0)
if(routes[i].nexthop == nexthop && routes[i].dest == dest)
return &routes[i];
}
return NULL;
......@@ -306,7 +305,7 @@ update_route(const unsigned char *d, int seqno, int refmetric,
metric = MIN(refmetric + neighbour_cost(nexthop), INFINITY);
route = find_route(d, nexthop);
route = find_route(dest, nexthop);
if(route) {
int oldseqno;
......
......@@ -39,7 +39,7 @@ extern int kernel_metric;
extern int route_timeout_delay;
extern int route_gc_delay;
struct route *find_route(const unsigned char *dest, struct neighbour *nexthop);
struct route *find_route(struct destination *dest, struct neighbour *nexthop);
struct route *find_installed_route(struct destination *dest);
void flush_route(struct route *route);
void flush_neighbour_routes(struct neighbour *neigh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment