Commit f9562668 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't avoid fresh routes in route selection.

parent 8b6dabf7
...@@ -240,8 +240,7 @@ update_feasible(const unsigned char *a, ...@@ -240,8 +240,7 @@ update_feasible(const unsigned char *a,
(src->seqno == seqno && refmetric < src->metric)); (src->seqno == seqno && refmetric < src->metric));
} }
/* This returns a feasible route. The only condition it must satisfy if that /* This returns the feasible route with the smallest metric. */
if there is a feasible route, then one will be found. */
struct route * struct route *
find_best_route(const unsigned char *prefix, unsigned char plen) find_best_route(const unsigned char *prefix, unsigned char plen)
{ {
...@@ -255,16 +254,8 @@ find_best_route(const unsigned char *prefix, unsigned char plen) ...@@ -255,16 +254,8 @@ find_best_route(const unsigned char *prefix, unsigned char plen)
continue; continue;
if(!route_feasible(&routes[i])) if(!route_feasible(&routes[i]))
continue; continue;
if(route && route->metric < INFINITY && if(route && route->metric <= routes[i].metric)
route->metric + 512 >= routes[i].metric) {
if(route->origtime <= now.tv_sec - 30 &&
routes[i].origtime >= now.tv_sec - 30)
continue; continue;
if(route->metric < routes[i].metric)
continue;
if(route->origtime > routes[i].origtime)
continue;
}
route = &routes[i]; route = &routes[i];
} }
return route; return route;
...@@ -462,10 +453,6 @@ consider_route(struct route *route) ...@@ -462,10 +453,6 @@ consider_route(struct route *route)
if(installed->metric >= route->metric + 288) if(installed->metric >= route->metric + 288)
goto install; goto install;
/* Avoid routes that haven't been around for some time */
if(route->origtime >= now.tv_sec - 30)
return;
if(installed->metric >= route->metric + 192) if(installed->metric >= route->metric + 192)
goto install; goto install;
......
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