control/controlclient, tailcfg: turn active route discovery on by default

Updates #483
pull/522/head
Brad Fitzpatrick 4 years ago
parent 3f74859bb0
commit c9089c82e8

@ -483,6 +483,7 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM
Endpoints: ep, Endpoints: ep,
Stream: allowStream, Stream: allowStream,
Hostinfo: hostinfo, Hostinfo: hostinfo,
DebugForceDisco: Debug.ForceDisco,
} }
if c.newDecompressor != nil { if c.newDecompressor != nil {
request.Compress = "zstd" request.Compress = "zstd"
@ -785,14 +786,20 @@ type debug struct {
NetMap bool NetMap bool
OnlyDisco bool OnlyDisco bool
Disco bool Disco bool
ForceDisco bool // ask control server to not filter out our disco key
} }
func initDebug() debug { func initDebug() debug {
return debug{ d := debug{
NetMap: envBool("TS_DEBUG_NETMAP"), NetMap: envBool("TS_DEBUG_NETMAP"),
OnlyDisco: os.Getenv("TS_DEBUG_USE_DISCO") == "only", OnlyDisco: os.Getenv("TS_DEBUG_USE_DISCO") == "only",
Disco: os.Getenv("TS_DEBUG_USE_DISCO") == "only" || envBool("TS_DEBUG_USE_DISCO"), ForceDisco: os.Getenv("TS_DEBUG_USE_DISCO") == "only" || envBool("TS_DEBUG_USE_DISCO"),
} }
if d.ForceDisco || os.Getenv("TS_DEBUG_USE_DISCO") == "" {
// This is now defaults to on.
d.Disco = true
}
return d
} }
func envBool(k string) bool { func envBool(k string) bool {

@ -454,6 +454,12 @@ type MapRequest struct {
IncludeIPv6 bool // include IPv6 endpoints in returned Node Endpoints IncludeIPv6 bool // include IPv6 endpoints in returned Node Endpoints
Stream bool // if true, multiple MapResponse objects are returned Stream bool // if true, multiple MapResponse objects are returned
Hostinfo *Hostinfo Hostinfo *Hostinfo
// DebugForceDisco is a temporary flag during the deployment
// of magicsock active discovery. It says that that the client
// has environment variables explicitly turning discovery on,
// so control should not disable it.
DebugForceDisco bool `json:"debugForceDisco,omitempty"`
} }
// PortRange represents a range of UDP or TCP port numbers. // PortRange represents a range of UDP or TCP port numbers.

Loading…
Cancel
Save