|
|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
"go4.org/mem"
|
|
|
|
"go4.org/mem"
|
|
|
|
"tailscale.com/control/controlknobs"
|
|
|
|
"tailscale.com/control/controlknobs"
|
|
|
|
|
|
|
|
"tailscale.com/envknob"
|
|
|
|
"tailscale.com/net/netaddr"
|
|
|
|
"tailscale.com/net/netaddr"
|
|
|
|
"tailscale.com/net/neterror"
|
|
|
|
"tailscale.com/net/neterror"
|
|
|
|
"tailscale.com/net/netmon"
|
|
|
|
"tailscale.com/net/netmon"
|
|
|
|
@ -32,6 +33,8 @@ import (
|
|
|
|
"tailscale.com/util/clientmetric"
|
|
|
|
"tailscale.com/util/clientmetric"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var disablePortMapperEnv = envknob.RegisterBool("TS_DISABLE_PORTMAPPER")
|
|
|
|
|
|
|
|
|
|
|
|
// DebugKnobs contains debug configuration that can be provided when creating a
|
|
|
|
// DebugKnobs contains debug configuration that can be provided when creating a
|
|
|
|
// Client. The zero value is valid for use.
|
|
|
|
// Client. The zero value is valid for use.
|
|
|
|
type DebugKnobs struct {
|
|
|
|
type DebugKnobs struct {
|
|
|
|
@ -55,6 +58,9 @@ type DebugKnobs struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (k *DebugKnobs) disableAll() bool {
|
|
|
|
func (k *DebugKnobs) disableAll() bool {
|
|
|
|
|
|
|
|
if disablePortMapperEnv() {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
if k.DisableAll != nil {
|
|
|
|
if k.DisableAll != nil {
|
|
|
|
return k.DisableAll()
|
|
|
|
return k.DisableAll()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|