diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index b38552e2d..3e77d0a99 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -49,6 +49,7 @@ import ( "tailscale.com/util/systemd" "tailscale.com/version" "tailscale.com/wgengine/filter" + "tailscale.com/wgengine/monitor" ) // Direct is the client that connects to a tailcontrol server for a node. @@ -60,6 +61,7 @@ type Direct struct { newDecompressor func() (Decompressor, error) keepAlive bool logf logger.Logf + linkMon *monitor.Mon // or nil discoPubKey tailcfg.DiscoKey machinePrivKey wgkey.Private debugFlags []string @@ -91,6 +93,7 @@ type Options struct { Logf logger.Logf HTTPTestClient *http.Client // optional HTTP client to use (for tests only) DebugFlags []string // debug settings to send to control + LinkMonitor *monitor.Mon // optional link monitor // KeepSharerAndUserSplit controls whether the client // 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, debugFlags: opts.DebugFlags, keepSharerAndUserSplit: opts.KeepSharerAndUserSplit, + linkMon: opts.LinkMonitor, } if opts.Hostinfo == nil { c.SetHostinfo(NewHostinfo()) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 1d1502605..c17ed86b0 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -554,6 +554,7 @@ func (b *LocalBackend) Start(opts ipn.Options) error { HTTPTestClient: opts.HTTPTestClient, DiscoPublicKey: discoPublic, DebugFlags: controlDebugFlags, + LinkMonitor: b.e.GetLinkMonitor(), }) if err != nil { return err