From a8ee32cbdddbf44eea1cc5a64423dd646eaa9f8f Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 13 Mar 2017 23:19:06 -0700 Subject: [PATCH] Fixes RTT command to only compare coordinates in the same area. --- command/rtt.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/command/rtt.go b/command/rtt.go index 04b23bcfa9..8fab465237 100644 --- a/command/rtt.go +++ b/command/rtt.go @@ -102,21 +102,29 @@ func (c *RTTCommand) Run(args []string) int { return 1 } - // See if the requested nodes are in there. + // See if the requested nodes are in there. We only compare + // coordinates in the same areas. + var area1, area2 string for _, dc := range dcs { for _, entry := range dc.Coordinates { if dc.Datacenter == dc1 && entry.Node == node1 { + area1 = dc.AreaID coord1 = entry.Coord } if dc.Datacenter == dc2 && entry.Node == node2 { + area2 = dc.AreaID coord2 = entry.Coord } - if coord1 != nil && coord2 != nil { + if area1 == area2 && coord1 != nil && coord2 != nil { goto SHOW_RTT } } } + + // Nil out the coordinates so we don't display across areas if + // we didn't find anything. + coord1, coord2 = nil, nil } else { source = "LAN"