Commit 2afb6362 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make sure we don't resend a request to the requestor.

parent 2f30f39e
...@@ -274,18 +274,20 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix, ...@@ -274,18 +274,20 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
struct route *successor_route; struct route *successor_route;
/* We usually want to send the request to our selected successor, /* We usually want to send the request to our selected successor,
but not when we suspect that it's dead. So pick the best but not when it's the requestor, and not when we suspect that
successor (feasible of not) if our selected successor's it's dead. So pick the best successor (feasible or not)
metric is suspiciously large. */ if our selected successor's metric is suspiciously large. */
successor_route = find_best_route(prefix, plen, 0, neigh); successor_route = find_best_route(prefix, plen, 0, neigh);
if(!successor_route || successor_route->metric >= INFINITY) if(!successor_route || successor_route->metric >= INFINITY ||
successor_route->neigh == neigh)
successor_route = route; successor_route = route;
else if(route && successor_route && else if(route && successor_route &&
successor_route->metric + 256 >= route->metric) successor_route->metric + 256 >= route->metric)
successor_route = route; successor_route = route;
if(!successor_route || successor_route->metric >= INFINITY) if(!successor_route || successor_route->metric >= INFINITY ||
successor_route->neigh == neigh)
return; return;
send_unicast_request(successor_route->neigh, prefix, plen, send_unicast_request(successor_route->neigh, prefix, plen,
......
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