If no link found, return max possible value
This commit is contained in:
parent
f4f178c130
commit
b3d4a7f740
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash/fnv"
|
"hash/fnv"
|
||||||
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -675,7 +676,7 @@ func (n *network) getRouteMetric(router string, gateway string) int64 {
|
|||||||
}
|
}
|
||||||
return (delay * length * int64(hops)) / 10e9
|
return (delay * length * int64(hops)) / 10e9
|
||||||
}
|
}
|
||||||
return 0
|
return math.MaxInt64
|
||||||
}
|
}
|
||||||
|
|
||||||
// getHopCount queries network graph and returns hop count for given router
|
// getHopCount queries network graph and returns hop count for given router
|
||||||
|
Loading…
Reference in New Issue
Block a user