Commit 220796f2 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make sure to send route requests when we loose a route.

parent 2060f656
...@@ -101,7 +101,8 @@ flush_route(struct route *route) ...@@ -101,7 +101,8 @@ flush_route(struct route *route)
} }
send_update(route->dest, NULL); send_update(route->dest, NULL);
} }
if(!new_route || new_route->metric >= INFINITY) if(oldmetric < INFINITY &&
(!new_route || new_route->metric >= INFINITY))
send_request(NULL, route->dest, max_hopcount, -1); send_request(NULL, route->dest, max_hopcount, -1);
} }
} }
...@@ -426,9 +427,15 @@ send_triggered_update(struct route *route, int oldmetric) ...@@ -426,9 +427,15 @@ send_triggered_update(struct route *route, int oldmetric)
(route->metric - oldmetric >= 256 || oldmetric - route->metric >= 256)) (route->metric - oldmetric >= 256 || oldmetric - route->metric >= 256))
send_update(route->dest, NULL); send_update(route->dest, NULL);
if(route->metric - oldmetric >= 384) { if(oldmetric < INFINITY) {
/* This route's metric has increased a lot -- let's hope we find if(route->metric >= INFINITY) {
something better */ /* We just lost a route, request a new seqno from the source */
send_request(NULL, route->dest, 1, -1); send_unicast_request(route->nexthop, route->dest,
max_hopcount, -1);
} else if(route->metric - oldmetric >= 384) {
/* This route's metric has increased a lot -- let's hope we find
something better */
send_request(NULL, route->dest, 1, -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