mirror of
https://github.com/tailscale/tailscale.git
synced 2025-09-21 13:41:46 +02:00
wgengine/magicsock: add TS_DEBUG_NEVER_DIRECT_UDP debug knob (#17094)
Updates tailscale/corp#30903 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
32bfd72752
commit
fb9d9ba86e
@ -62,6 +62,9 @@ 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")
|
||||||
|
// debugNeverDirectUDP disables the use of direct UDP connections, forcing
|
||||||
|
// all peer communication over DERP or peer relay.
|
||||||
|
debugNeverDirectUDP = envknob.RegisterBool("TS_DEBUG_NEVER_DIRECT_UDP")
|
||||||
// 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 debugNeverDirectUDP() bool { return false }
|
||||||
|
@ -1286,6 +1286,9 @@ func (de *endpoint) startDiscoPingLocked(ep epAddr, now mono.Time, purpose disco
|
|||||||
if runtime.GOOS == "js" {
|
if runtime.GOOS == "js" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if debugNeverDirectUDP() && !ep.vni.IsSet() && ep.ap.Addr() != tailcfg.DerpMagicIPAddr {
|
||||||
|
return
|
||||||
|
}
|
||||||
epDisco := de.disco.Load()
|
epDisco := de.disco.Load()
|
||||||
if epDisco == nil {
|
if epDisco == nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user