@ -2498,6 +2498,9 @@ func (b *LocalBackend) onClientVersion(v *tailcfg.ClientVersion) {
}
}
func ( b * LocalBackend ) onTailnetDefaultAutoUpdate ( au bool ) {
func ( b * LocalBackend ) onTailnetDefaultAutoUpdate ( au bool ) {
unlock := b . lockAndGetUnlock ( )
defer unlock ( )
prefs := b . pm . CurrentPrefs ( )
prefs := b . pm . CurrentPrefs ( )
if ! prefs . Valid ( ) {
if ! prefs . Valid ( ) {
b . logf ( "[unexpected]: received tailnet default auto-update callback but current prefs are nil" )
b . logf ( "[unexpected]: received tailnet default auto-update callback but current prefs are nil" )
@ -2511,12 +2514,12 @@ func (b *LocalBackend) onTailnetDefaultAutoUpdate(au bool) {
b . logf ( "using tailnet default auto-update setting: %v" , au )
b . logf ( "using tailnet default auto-update setting: %v" , au )
prefsClone := prefs . AsStruct ( )
prefsClone := prefs . AsStruct ( )
prefsClone . AutoUpdate . Apply = opt . NewBool ( au )
prefsClone . AutoUpdate . Apply = opt . NewBool ( au )
_ , err := b . EditPrefs ( & ipn . MaskedPrefs {
_ , err := b . editPrefsLockedOnEntry ( & ipn . MaskedPrefs {
Prefs : * prefsClone ,
Prefs : * prefsClone ,
AutoUpdateSet : ipn . AutoUpdatePrefsMask {
AutoUpdateSet : ipn . AutoUpdatePrefsMask {
ApplySet : true ,
ApplySet : true ,
} ,
} ,
} )
} , unlock )
if err != nil {
if err != nil {
b . logf ( "failed to apply tailnet-wide default for auto-updates (%v): %v" , au , err )
b . logf ( "failed to apply tailnet-wide default for auto-updates (%v): %v" , au , err )
return
return