Commit 5202c214 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Send a request for a full route dump when a new neighbour appears.

parent 3c017806
...@@ -29,6 +29,7 @@ THE SOFTWARE. ...@@ -29,6 +29,7 @@ THE SOFTWARE.
#include "babel.h" #include "babel.h"
#include "util.h" #include "util.h"
#include "neighbour.h" #include "neighbour.h"
#include "destination.h"
#include "route.h" #include "route.h"
#include "message.h" #include "message.h"
...@@ -168,6 +169,19 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval) ...@@ -168,6 +169,19 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
send_neighbour_update(neigh, NULL); send_neighbour_update(neigh, NULL);
} }
} }
if(neigh->reach == 0xC000) {
/* This is a newish neighbour. Assume its id is also its IP address.
If the best route to it is through it, send it a request
for a full route dump. */
struct destination *dest;
struct route *route = NULL;
dest = find_destination(neigh->id, 0, 0);
if(dest)
route = find_best_route(dest);
if(!route || route->nexthop == neigh)
send_unicast_request(neigh, NULL);
}
} }
void void
......
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