ipn/ipnlocal: fix AllowsUpdate disable after enable (#9827)

The old code would always retain value `true` if it was set once, even
if you then change `prefs.AutoUpdate.Apply` to `false`.
Instead of using the previous value, use the default (envknob) value to
OR with.

Updates #755

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
pull/9832/head
Andrew Lytvynov 1 year ago committed by GitHub
parent 18bd98d35b
commit b949e208bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3793,7 +3793,7 @@ func (b *LocalBackend) applyPrefsToHostinfoLocked(hi *tailcfg.Hostinfo, prefs ip
hi.RoutableIPs = prefs.AdvertiseRoutes().AsSlice() hi.RoutableIPs = prefs.AdvertiseRoutes().AsSlice()
hi.RequestTags = prefs.AdvertiseTags().AsSlice() hi.RequestTags = prefs.AdvertiseTags().AsSlice()
hi.ShieldsUp = prefs.ShieldsUp() hi.ShieldsUp = prefs.ShieldsUp()
hi.AllowsUpdate = hi.AllowsUpdate || prefs.AutoUpdate().Apply hi.AllowsUpdate = envknob.AllowsRemoteUpdate() || prefs.AutoUpdate().Apply
var sshHostKeys []string var sshHostKeys []string
if prefs.RunSSH() && envknob.CanSSHD() { if prefs.RunSSH() && envknob.CanSSHD() {

Loading…
Cancel
Save