mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
Reset dial plan when switching profile (#11933)
When switching profile, the server URL can change (e.g. because of switching to a self-hosted headscale instance). If it is not reset here, dial plans returned by old server (e.g. tailscale control server) will be used to connect to new server (e.g. self-hosted headscale server), and the register request will be blocked by it until timeout, leading to very slow profile switches. Updates #11938 11938 Signed-off-by: Shaw Drastin <showier.drastic0a@icloud.com>
This commit is contained in:
parent
a47ce618bd
commit
1fe073098c
@ -5881,6 +5881,11 @@ func (b *LocalBackend) SwitchProfile(profile ipn.ProfileID) error {
|
||||
if err := b.pm.SwitchProfile(profile); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: Check if serverUrl in the switched profile is actually changed;
|
||||
// if not, then no need to reset dial plan
|
||||
b.dialPlan.Store(nil)
|
||||
|
||||
return b.resetForProfileChangeLockedOnEntry(unlock)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user