mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-23 14:02:21 +00:00
Close #95: Account for link cost in route select
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
1 file changed
+3
-1
+3
-1
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user