If no link found, return max possible value

This commit is contained in:
Milos Gajdos 2019-10-23 16:48:47 +01:00
parent f4f178c130
commit b3d4a7f740
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -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