wgengine/magicsock: move UDP relay path discovery to heartbeat() (#16407)

This was previously hooked around direct UDP path discovery /
CallMeMaybe transmission, and related conditions. Now it is subject to
relay-specific considerations.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-06-27 13:56:55 -07:00
committed by GitHub
parent 711698f5a9
commit 0a64e86a0d
3 changed files with 118 additions and 18 deletions

View File

@@ -3494,9 +3494,17 @@ const (
// keep NAT mappings alive.
sessionActiveTimeout = 45 * time.Second
// upgradeInterval is how often we try to upgrade to a better path
// even if we have some non-DERP route that works.
upgradeInterval = 1 * time.Minute
// upgradeUDPDirectInterval is how often we try to upgrade to a better,
// direct UDP path even if we have some direct UDP path that works.
upgradeUDPDirectInterval = 1 * time.Minute
// upgradeUDPRelayInterval is how often we try to discover UDP relay paths
// even if we have a UDP relay path that works.
upgradeUDPRelayInterval = 1 * time.Minute
// discoverUDPRelayPathsInterval is the minimum time between UDP relay path
// discovery.
discoverUDPRelayPathsInterval = 30 * time.Second
// heartbeatInterval is how often pings to the best UDP address
// are sent.