From fcca374fa77730d47f4aa42ed0aeb9ab45906b1a Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 18 Aug 2021 14:19:21 -0700 Subject: [PATCH] tstest/integration/testcontrol: sort peers in map response This is part of the control protocol. Signed-off-by: Josh Bleecher Snyder --- tstest/integration/testcontrol/testcontrol.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tstest/integration/testcontrol/testcontrol.go b/tstest/integration/testcontrol/testcontrol.go index 7f6792f3d..9454df298 100644 --- a/tstest/integration/testcontrol/testcontrol.go +++ b/tstest/integration/testcontrol/testcontrol.go @@ -661,6 +661,9 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse, res.Peers = append(res.Peers, p) } } + sort.Slice(res.Peers, func(i, j int) bool { + return res.Peers[i].ID < res.Peers[j].ID + }) v4Prefix := netaddr.IPPrefixFrom(netaddr.IPv4(100, 64, uint8(tailcfg.NodeID(user.ID)>>8), uint8(tailcfg.NodeID(user.ID))), 32) v6Prefix := netaddr.IPPrefixFrom(tsaddr.Tailscale4To6(v4Prefix.IP()), 128)