From b8a4c96c53f12c9c32b1cbc858d60f7bc366f970 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 12 Sep 2023 15:59:38 -0700 Subject: [PATCH] wgengine: remove LinkChange method from Engine interface It was only used by Android, until https://github.com/tailscale/tailscale-android/pull/131 which does the call to the netMon directly instead. Updates #cleanup Change-Id: Iab8a1d8f1e63250705835c75f40e2cd8c1c4d5b8 Signed-off-by: Brad Fitzpatrick --- wgengine/userspace.go | 7 ------- wgengine/watchdog.go | 3 --- wgengine/wgengine.go | 15 --------------- 3 files changed, 25 deletions(-) diff --git a/wgengine/userspace.go b/wgengine/userspace.go index 851727795..ea40d01fa 100644 --- a/wgengine/userspace.go +++ b/wgengine/userspace.go @@ -1099,13 +1099,6 @@ func (e *userspaceEngine) Wait() { <-e.waitCh } -// LinkChange signals a network change event. It's currently -// (2021-03-03) only called on Android. On other platforms, netMon -// generates link change events for us. -func (e *userspaceEngine) LinkChange(_ bool) { - e.netMon.InjectEvent() -} - func (e *userspaceEngine) linkChange(delta *netmon.ChangeDelta) { changed := delta.Major // TODO(bradfitz): ask more specific questions? cur := delta.New diff --git a/wgengine/watchdog.go b/wgengine/watchdog.go index f8fdc9b95..a5e1e8917 100644 --- a/wgengine/watchdog.go +++ b/wgengine/watchdog.go @@ -137,9 +137,6 @@ func (e *watchdogEngine) UpdateStatus(sb *ipnstate.StatusBuilder) { func (e *watchdogEngine) RequestStatus() { e.watchdog("RequestStatus", func() { e.wrap.RequestStatus() }) } -func (e *watchdogEngine) LinkChange(isExpensive bool) { - e.watchdog("LinkChange", func() { e.wrap.LinkChange(isExpensive) }) -} func (e *watchdogEngine) SetDERPMap(m *tailcfg.DERPMap) { e.watchdog("SetDERPMap", func() { e.wrap.SetDERPMap(m) }) } diff --git a/wgengine/wgengine.go b/wgengine/wgengine.go index 1991174b9..68956729c 100644 --- a/wgengine/wgengine.go +++ b/wgengine/wgengine.go @@ -95,21 +95,6 @@ type Engine interface { // TODO: return an error? Wait() - // LinkChange informs the engine that the system network - // link has changed. - // - // The isExpensive parameter is not used. - // - // LinkChange should be called whenever something changed with - // the network, no matter how minor. - // - // Deprecated: don't use this method. It was removed shortly - // before the Tailscale 1.6 release when we remembered that - // Android doesn't use the Linux-based network monitor and has - // its own mechanism that uses LinkChange. Android is the only - // caller of this method now. Don't add more. - LinkChange(isExpensive bool) - // SetDERPMap controls which (if any) DERP servers are used. // If nil, DERP is disabled. It starts disabled until a DERP map // is configured.