@@ -823,7 +823,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
|
||||
log.Tracef("Network metric for router %s and gateway %s: %v", event.Route.Router, event.Route.Gateway, metric)
|
||||
|
||||
// check we don't overflow max int 64
|
||||
if d := route.Metric + metric; d > math.MaxInt64 || d <= 0 {
|
||||
if d := route.Metric + metric; d <= 0 {
|
||||
// set to max int64 if we overflow
|
||||
route.Metric = math.MaxInt64
|
||||
} else {
|
||||
|
@@ -94,11 +94,6 @@ func (n *Network) Connect(ctx context.Context, req *pbNet.ConnectRequest, resp *
|
||||
|
||||
// Nodes returns the list of nodes
|
||||
func (n *Network) Nodes(ctx context.Context, req *pbNet.NodesRequest, resp *pbNet.NodesResponse) error {
|
||||
depth := uint(req.Depth)
|
||||
if depth <= 0 || depth > network.MaxDepth {
|
||||
depth = network.MaxDepth
|
||||
}
|
||||
|
||||
// root node
|
||||
nodes := map[string]network.Node{}
|
||||
|
||||
|
Reference in New Issue
Block a user