tstest/integration/testcontrol: include peer CapMaps in MapResponses

Fixes #16560
Signed-off-by: Raj Singh <raj@tailscale.com>
This commit is contained in:
Raj Singh
2025-07-14 15:23:45 -05:00
committed by Brad Fitzpatrick
parent f421907c38
commit d6d29abbb6
2 changed files with 151 additions and 0 deletions

View File

@@ -1000,7 +1000,11 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse,
s.mu.Lock()
peerAddress := s.masquerades[p.Key][node.Key]
routes := s.nodeSubnetRoutes[p.Key]
peerCapMap := maps.Clone(s.nodeCapMaps[p.Key])
s.mu.Unlock()
if peerCapMap != nil {
p.CapMap = peerCapMap
}
if peerAddress.IsValid() {
if peerAddress.Is6() {
p.Addresses[1] = netip.PrefixFrom(peerAddress, peerAddress.BitLen())