net/netcheck: preserve STUN port defaulting to 3478 (#14289)

Updates tailscale/tailscale#14287

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina
2024-12-05 13:21:03 +00:00
committed by GitHub
parent df94a14870
commit 614c612643

View File

@@ -1570,6 +1570,9 @@ func (c *Client) nodeAddrPort(ctx context.Context, n *tailcfg.DERPNode, port int
if port < 0 || port > 1<<16-1 {
return zero, false
}
if port == 0 {
port = 3478
}
if n.STUNTestIP != "" {
ip, err := netip.ParseAddr(n.STUNTestIP)
if err != nil {