mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-01 19:51:58 +00:00
example for jordan
Change-Id: I28400c94605110dcbac394fc7bfb61797c1e4b82 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
fbc18410ad
commit
530056811a
@ -52,6 +52,8 @@ type Knobs struct {
|
|||||||
// DisableDNSForwarderTCPRetries is whether the DNS forwarder should
|
// DisableDNSForwarderTCPRetries is whether the DNS forwarder should
|
||||||
// skip retrying truncated queries over TCP.
|
// skip retrying truncated queries over TCP.
|
||||||
DisableDNSForwarderTCPRetries atomic.Bool
|
DisableDNSForwarderTCPRetries atomic.Bool
|
||||||
|
|
||||||
|
SilentDisco atomic.Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
|
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
|
||||||
@ -74,6 +76,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability,
|
|||||||
forceBackgroundSTUN = has(tailcfg.NodeAttrDebugForceBackgroundSTUN)
|
forceBackgroundSTUN = has(tailcfg.NodeAttrDebugForceBackgroundSTUN)
|
||||||
peerMTUEnable = has(tailcfg.NodeAttrPeerMTUEnable)
|
peerMTUEnable = has(tailcfg.NodeAttrPeerMTUEnable)
|
||||||
dnsForwarderDisableTCPRetries = has(tailcfg.NodeAttrDNSForwarderDisableTCPRetries)
|
dnsForwarderDisableTCPRetries = has(tailcfg.NodeAttrDNSForwarderDisableTCPRetries)
|
||||||
|
silentDisco = has(tailcfg.NodeAttrSilentDisco)
|
||||||
)
|
)
|
||||||
|
|
||||||
if has(tailcfg.NodeAttrOneCGNATEnable) {
|
if has(tailcfg.NodeAttrOneCGNATEnable) {
|
||||||
@ -91,6 +94,7 @@ func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability,
|
|||||||
k.DisableDeltaUpdates.Store(disableDeltaUpdates)
|
k.DisableDeltaUpdates.Store(disableDeltaUpdates)
|
||||||
k.PeerMTUEnable.Store(peerMTUEnable)
|
k.PeerMTUEnable.Store(peerMTUEnable)
|
||||||
k.DisableDNSForwarderTCPRetries.Store(dnsForwarderDisableTCPRetries)
|
k.DisableDNSForwarderTCPRetries.Store(dnsForwarderDisableTCPRetries)
|
||||||
|
k.SilentDisco.Store(silentDisco)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
|
// AsDebugJSON returns k as something that can be marshalled with json.Marshal
|
||||||
|
@ -4348,6 +4348,8 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
|
|||||||
}
|
}
|
||||||
b.capFileSharing = fs
|
b.capFileSharing = fs
|
||||||
|
|
||||||
|
b.magicConn().SetSilentDisco(b.ControlKnobs().SilentDisco.Load())
|
||||||
|
|
||||||
b.setDebugLogsByCapabilityLocked(nm)
|
b.setDebugLogsByCapabilityLocked(nm)
|
||||||
|
|
||||||
// See the netns package for documentation on what this capability does.
|
// See the netns package for documentation on what this capability does.
|
||||||
|
@ -2126,6 +2126,8 @@ const (
|
|||||||
// fixed port.
|
// fixed port.
|
||||||
NodeAttrRandomizeClientPort NodeCapability = "randomize-client-port"
|
NodeAttrRandomizeClientPort NodeCapability = "randomize-client-port"
|
||||||
|
|
||||||
|
NodeAttrSilentDisco NodeCapability = "silent-disco"
|
||||||
|
|
||||||
// NodeAttrOneCGNATEnable makes the client prefer one big CGNAT /10 route
|
// NodeAttrOneCGNATEnable makes the client prefer one big CGNAT /10 route
|
||||||
// rather than a /32 per peer. At most one of this or
|
// rather than a /32 per peer. At most one of this or
|
||||||
// NodeAttrOneCGNATDisable may be set; if neither are, it's automatic.
|
// NodeAttrOneCGNATDisable may be set; if neither are, it's automatic.
|
||||||
|
@ -139,6 +139,8 @@ type Conn struct {
|
|||||||
// logging.
|
// logging.
|
||||||
noV4, noV6 atomic.Bool
|
noV4, noV6 atomic.Bool
|
||||||
|
|
||||||
|
silentDiscoOn atomic.Bool // whether silent disco is enabled
|
||||||
|
|
||||||
// noV4Send is whether IPv4 UDP is known to be unable to transmit
|
// noV4Send is whether IPv4 UDP is known to be unable to transmit
|
||||||
// at all. This could happen if the socket is in an invalid state
|
// at all. This could happen if the socket is in an invalid state
|
||||||
// (as can happen on darwin after a network link status change).
|
// (as can happen on darwin after a network link status change).
|
||||||
@ -1801,6 +1803,14 @@ func (c *Conn) debugFlagsLocked() (f debugFlags) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Conn) SetSilentDisco(v bool) {
|
||||||
|
old := c.silentDiscoOn.Swap(v)
|
||||||
|
if old == v {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// ....
|
||||||
|
}
|
||||||
|
|
||||||
// SetNetworkMap is called when the control client gets a new network
|
// SetNetworkMap is called when the control client gets a new network
|
||||||
// map from the control server. It must always be non-nil.
|
// map from the control server. It must always be non-nil.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user