mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 00:03:47 +00:00
wgengine/magicsock: add envknob to toggle UDP relay feature (#16396)
Updates tailscale/corp#27502 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
6feb3c35cb
commit
b2bf7e988e
@ -62,6 +62,12 @@ var (
|
|||||||
//
|
//
|
||||||
//lint:ignore U1000 used on Linux/Darwin only
|
//lint:ignore U1000 used on Linux/Darwin only
|
||||||
debugPMTUD = envknob.RegisterBool("TS_DEBUG_PMTUD")
|
debugPMTUD = envknob.RegisterBool("TS_DEBUG_PMTUD")
|
||||||
|
// debugAssumeUDPRelayCapable forces magicsock to assume that all peers are
|
||||||
|
// UDP relay capable clients and servers. This will eventually be replaced
|
||||||
|
// by a [tailcfg.CapabilityVersion] comparison. It enables early testing of
|
||||||
|
// the UDP relay feature before we have established related
|
||||||
|
// [tailcfg.CapabilityVersion]'s.
|
||||||
|
debugAssumeUDPRelayCapable = envknob.RegisterBool("TS_DEBUG_ASSUME_UDP_RELAY_CAPABLE")
|
||||||
// Hey you! Adding a new debugknob? Make sure to stub it out in the
|
// Hey you! Adding a new debugknob? Make sure to stub it out in the
|
||||||
// debugknobs_stubs.go file too.
|
// debugknobs_stubs.go file too.
|
||||||
)
|
)
|
||||||
|
@ -31,3 +31,4 @@ func debugRingBufferMaxSizeBytes() int { return 0 }
|
|||||||
func inTest() bool { return false }
|
func inTest() bool { return false }
|
||||||
func debugPeerMap() bool { return false }
|
func debugPeerMap() bool { return false }
|
||||||
func pretendpoints() []netip.AddrPort { return []netip.AddrPort{} }
|
func pretendpoints() []netip.AddrPort { return []netip.AddrPort{} }
|
||||||
|
func debugAssumeUDPRelayCapable() bool { return false }
|
||||||
|
@ -2592,12 +2592,12 @@ func (c *Conn) SetProbeUDPLifetime(v bool) {
|
|||||||
|
|
||||||
func capVerIsRelayCapable(version tailcfg.CapabilityVersion) bool {
|
func capVerIsRelayCapable(version tailcfg.CapabilityVersion) bool {
|
||||||
// TODO(jwhited): implement once capVer is bumped
|
// TODO(jwhited): implement once capVer is bumped
|
||||||
return version == math.MinInt32
|
return version == math.MinInt32 || debugAssumeUDPRelayCapable()
|
||||||
}
|
}
|
||||||
|
|
||||||
func capVerIsRelayServerCapable(version tailcfg.CapabilityVersion) bool {
|
func capVerIsRelayServerCapable(version tailcfg.CapabilityVersion) bool {
|
||||||
// TODO(jwhited): implement once capVer is bumped
|
// TODO(jwhited): implement once capVer is bumped & update Test_peerAPIIfCandidateRelayServer
|
||||||
return version == math.MinInt32
|
return version == math.MinInt32 || debugAssumeUDPRelayCapable()
|
||||||
}
|
}
|
||||||
|
|
||||||
// onFilterUpdate is called when a [FilterUpdate] is received over the
|
// onFilterUpdate is called when a [FilterUpdate] is received over the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user