diff options
| author | Nick Khyl <nickk@tailscale.com> | 2025-05-09 20:19:36 -0500 |
|---|---|---|
| committer | Nick Khyl <nickk@tailscale.com> | 2025-05-09 20:19:36 -0500 |
| commit | 4c09ea6c24a13102debb99d717949db71d40b36c (patch) | |
| tree | 7c92320a13cd1f4dbf84357644730be416f59131 | |
| parent | 565ebbdeb8c1140fb17a21f521d45f7fbd97fdd8 (diff) | |
| download | tailscale-nickkhyl/authreconfig-once.tar.xz tailscale-nickkhyl/authreconfig-once.zip | |
ipn/ipnlocal: call authReconfig once per cc status updatenickkhyl/authreconfig-once
Updates #12027
Signed-off-by: Nick Khyl <nickk@tailscale.com>
| -rw-r--r-- | ipn/ipnlocal/local.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 5d6433002..8a24f5e11 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -1550,13 +1550,23 @@ func (b *LocalBackend) SetControlClientStatus(c controlclient.Client, st control // Auth completed, unblock the engine b.blockEngineUpdates(false) } - b.authReconfig() b.send(ipn.Notify{LoginFinished: &empty.Message{}}) } // Lock b again and do only the things that require locking. b.mu.Lock() + // [LocalBackend.authReconfig] should be called once per control client status update, + // and only after the new netmap has been set. + // + // This is currently (2020-07-28) necessary; conditionally disabling it is fragile! + // This is where netmap information gets propagated to router and magicsock. + // + // TODO(nickkhyl): Revisit this after the state machine refactor. + // We shouldn't be calling it from five different places, and the authReconfig logic + // may need its own refactor. + defer b.authReconfig() + prefsChanged := false cn := b.currentNode() prefs := b.pm.CurrentPrefs().AsStruct() @@ -1718,9 +1728,6 @@ func (b *LocalBackend) SetControlClientStatus(c controlclient.Client, st control b.setAuthURL(st.URL) } b.stateMachine() - // This is currently (2020-07-28) necessary; conditionally disabling it is fragile! - // This is where netmap information gets propagated to router and magicsock. - b.authReconfig() } type preferencePolicyInfo struct { |
