ipn/ipnlocal, control/controlclient: propagate link monitor to controlclient
Don't use it yet, but get it down there. Updates #1455 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
d37b3b02cd
commit
affd859121
|
@ -49,6 +49,7 @@ import (
|
||||||
"tailscale.com/util/systemd"
|
"tailscale.com/util/systemd"
|
||||||
"tailscale.com/version"
|
"tailscale.com/version"
|
||||||
"tailscale.com/wgengine/filter"
|
"tailscale.com/wgengine/filter"
|
||||||
|
"tailscale.com/wgengine/monitor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Direct is the client that connects to a tailcontrol server for a node.
|
// Direct is the client that connects to a tailcontrol server for a node.
|
||||||
|
@ -60,6 +61,7 @@ type Direct struct {
|
||||||
newDecompressor func() (Decompressor, error)
|
newDecompressor func() (Decompressor, error)
|
||||||
keepAlive bool
|
keepAlive bool
|
||||||
logf logger.Logf
|
logf logger.Logf
|
||||||
|
linkMon *monitor.Mon // or nil
|
||||||
discoPubKey tailcfg.DiscoKey
|
discoPubKey tailcfg.DiscoKey
|
||||||
machinePrivKey wgkey.Private
|
machinePrivKey wgkey.Private
|
||||||
debugFlags []string
|
debugFlags []string
|
||||||
|
@ -91,6 +93,7 @@ type Options struct {
|
||||||
Logf logger.Logf
|
Logf logger.Logf
|
||||||
HTTPTestClient *http.Client // optional HTTP client to use (for tests only)
|
HTTPTestClient *http.Client // optional HTTP client to use (for tests only)
|
||||||
DebugFlags []string // debug settings to send to control
|
DebugFlags []string // debug settings to send to control
|
||||||
|
LinkMonitor *monitor.Mon // optional link monitor
|
||||||
|
|
||||||
// KeepSharerAndUserSplit controls whether the client
|
// KeepSharerAndUserSplit controls whether the client
|
||||||
// understands Node.Sharer. If false, the Sharer is mapped to the User.
|
// understands Node.Sharer. If false, the Sharer is mapped to the User.
|
||||||
|
@ -155,6 +158,7 @@ func NewDirect(opts Options) (*Direct, error) {
|
||||||
discoPubKey: opts.DiscoPublicKey,
|
discoPubKey: opts.DiscoPublicKey,
|
||||||
debugFlags: opts.DebugFlags,
|
debugFlags: opts.DebugFlags,
|
||||||
keepSharerAndUserSplit: opts.KeepSharerAndUserSplit,
|
keepSharerAndUserSplit: opts.KeepSharerAndUserSplit,
|
||||||
|
linkMon: opts.LinkMonitor,
|
||||||
}
|
}
|
||||||
if opts.Hostinfo == nil {
|
if opts.Hostinfo == nil {
|
||||||
c.SetHostinfo(NewHostinfo())
|
c.SetHostinfo(NewHostinfo())
|
||||||
|
|
|
@ -554,6 +554,7 @@ func (b *LocalBackend) Start(opts ipn.Options) error {
|
||||||
HTTPTestClient: opts.HTTPTestClient,
|
HTTPTestClient: opts.HTTPTestClient,
|
||||||
DiscoPublicKey: discoPublic,
|
DiscoPublicKey: discoPublic,
|
||||||
DebugFlags: controlDebugFlags,
|
DebugFlags: controlDebugFlags,
|
||||||
|
LinkMonitor: b.e.GetLinkMonitor(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue