Close #95: Account for link cost in route select

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2024-01-31 12:56:35 +01:00
1 parent 34f158fdf3
commit 33251c4c52
1 file changed
+3 -1
+3 -1
View File
@@ -798,7 +798,9 @@ impl Router {
// If we swap to an actually different route, only do so if the metric is
// significantly better OR if it is directly connected (metric 0).
if (best.source() != current.source() || best.neighbour() != current.neighbour())
&& !(best.metric() < current.metric() - SIGNIFICANT_METRIC_IMPROVEMENT
&& !(best.metric() + Metric::from(best.neighbour().link_cost())
< current.metric() + Metric::from(current.neighbour().link_cost())
- SIGNIFICANT_METRIC_IMPROVEMENT
|| best.metric().is_direct())
{
debug!("maintaining currently selected route since new route is not significantly better");