mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
ipn/ipnlocal: clear app connector storage on 'down'
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>
This commit is contained in:
parent
6f694da912
commit
008b0b8b2b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user