Commit 917040de authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

When sending requests to a new neighbour, check for installed routes.

parent e5522b49
...@@ -165,15 +165,15 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval) ...@@ -165,15 +165,15 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
} }
if((neigh->reach & 0xFF00) == 0xC000) { if((neigh->reach & 0xFF00) == 0xC000) {
/* This is a newish neighbour. If it's not completely useless /* This is a newish neighbour. If we don't have another route to it,
(the best route to it is through it), request a full route dump. request a full route dump. This assumes that the neighbour's ID
This assumes that the neighbour's ID is also its IP address. */ is also its IP address. */
struct destination *dest; struct destination *dest;
struct route *route = NULL; struct route *route = NULL;
dest = find_destination(neigh->id, 0, 0); dest = find_destination(neigh->id, 0, 0);
if(dest) if(dest)
route = find_best_route(dest); route = find_installed_route(dest);
if(!route || route->nexthop == neigh) if(!route || route->metric >= INFINITY || route->nexthop == neigh)
send_unicast_request(neigh, NULL, 0, -1); send_unicast_request(neigh, NULL, 0, -1);
} }
} }
......
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