diff options
| author | Fran Bull <fran@tailscale.com> | 2024-10-07 14:09:56 -0700 |
|---|---|---|
| committer | Fran Bull <fran@tailscale.com> | 2024-10-07 14:09:56 -0700 |
| commit | 008b0b8b2bb6eca31ef86b44a5d0c49d964d2641 (patch) | |
| tree | 7bb3b3a67dcf10ec3ccef28c42cb53c272507bb5 | |
| parent | 6f694da91286ba5b86912d7237f57cd3216739bb (diff) | |
| download | tailscale-fran/fix-appc-routes.tar.xz tailscale-fran/fix-appc-routes.zip | |
ipn/ipnlocal: clear app connector storage on 'down'fran/fix-appc-routes
App connectors store their routes in the state file, so that they may
have an understanding of which routes can be removed when app connectors
are reconfigured.
App connectors route storage is deleted if the AdvertisedRoutes are
edited by something else, such as `tailscale set`.
This should also happen on `tailscale down`.
Fixes #13680
Signed-off-by: Fran Bull <fran@tailscale.com>
| -rw-r--r-- | ipn/ipnlocal/local.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 8fc78a36b..3b94f91e8 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -3627,7 +3627,8 @@ func (b *LocalBackend) SetUseExitNodeEnabled(v bool) (ipn.PrefsView, error) { // AdvertiseRoutes has been set in the MaskedPrefs. func (b *LocalBackend) MaybeClearAppConnector(mp *ipn.MaskedPrefs) error { var err error - if b.appConnector != nil && mp.AdvertiseRoutesSet { + routesChanged := mp.AdvertiseRoutesSet || (mp.WantRunningSet && !mp.WantRunning) + if b.appConnector != nil && routesChanged { err = b.appConnector.ClearRoutes() if err != nil { b.logf("appc: clear routes error: %v", err) |
