mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-03 07:02:33 -08:00
lookupTransitIPsByConnID returned the connector's Transit IPs straight from a map-backed set, in map-iteration order. set.Set.Slice can't order them: it only sorts ordered kinds, and netip.Prefix is a struct. Both ends of the ExtraWireGuardAllowedIPs path require a stable order so that unchanged entries are detected as no-ops: the hook's contract in ipnext, and routemanager.Mutation.SetExtraAllowedIPs, whose applyExtras compares each peer's prefixes with slices.Equal. Without it an unchanged set looked changed, resyncing the WireGuard device peer for every connector on every reconfig. Sort the result, and drop the workaround sort in TestTransitIPConnMapping that was masking this, so that test asserts the order too. Fixes https://github.com/tailscale/corp/issues/52137 Change-Id: Ie4b17d69fb304a6411f534322314082a7feea542 Signed-off-by: Mazdak Nasab <[email protected]>