You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn
Avery Pennarun 6d10655dc3 ipnlocal: accept a new opts.UpdatePrefs field.
This is needed because the original opts.Prefs field was at some point
subverted for use in frontend->backend state migration for backward
compatibility on some platforms. We still need that feature, but we
also need the feature of providing the full set of prefs from
`tailscale up`, *not* including overwriting the prefs.Persist keys, so
we can't use the original field from `tailscale up`.

`tailscale up` had attempted to compensate for that by doing SetPrefs()
before Start(), but that violates the ipn.Backend contract, which says
you should call Start() before anything else (that's why it's called
Start()). As a result, doing SetPrefs({ControlURL=...,
WantRunning=true}) would cause a connection to the *previous* control
server (because WantRunning=true), and then connect to the *new*
control server only after running Start().

This problem may have been avoided before, but only by pure luck.

It turned out to be relatively harmless since the connection to the old
control server was immediately closed and replaced anyway, but it
created a race condition that could have caused spurious notifications
or rejected keys if the server responded quickly.

As already covered by existing TODOs, a better fix would be to have
Start() get out of the business of state migration altogether. But
we're approaching a release so I want to make the minimum possible fix.

Fixes #1840.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
3 years ago
..
ipnlocal ipnlocal: accept a new opts.UpdatePrefs field. 3 years ago
ipnserver cmd/tailscaled: don't block ipnserver startup behind engine init on Windows 3 years ago
ipnstate ipn/ipnlocal, etc: require file sharing capability to send/recv files 4 years ago
localapi ipn/ipnlocal, etc: require file sharing capability to send/recv files 4 years ago
policy ipn/policy: mark peerapi4 and peerapi6 as interesting services 4 years ago
backend.go ipnlocal: accept a new opts.UpdatePrefs field. 3 years ago
doc.go Move Linux client & common packages into a public repo. 5 years ago
fake_test.go ipn{,/ipnlocal}, cmd/tailscale/cli: don't check pref reverts on initial up 4 years ago
handle.go ipn{,/ipnlocal}, cmd/tailscale/cli: don't check pref reverts on initial up 4 years ago
message.go ipn: define NewBackendServer nil as not affecting Backend's NotifyCallback 3 years ago
message_test.go ipn: define NewBackendServer nil as not affecting Backend's NotifyCallback 3 years ago
prefs.go ipnlocal: accept a new opts.UpdatePrefs field. 3 years ago
prefs_clone.go Add prefs.LoggedOut to fix several state machine bugs. 3 years ago
prefs_test.go Add prefs.LoggedOut to fix several state machine bugs. 3 years ago
store.go wgkey: new package 4 years ago
store_test.go Add tstest.PanicOnLog(), and fix various problems detected by this. 4 years ago