@ -268,6 +268,9 @@ type LocalBackend struct {
// at the moment that tkaSyncLock is taken).
// at the moment that tkaSyncLock is taken).
tkaSyncLock sync . Mutex
tkaSyncLock sync . Mutex
clock tstime . Clock
clock tstime . Clock
// Last ClientVersion received in MapResponse, guarded by mu.
lastClientVersion * tailcfg . ClientVersion
}
}
type updateStatus struct {
type updateStatus struct {
@ -671,6 +674,9 @@ func (b *LocalBackend) updateStatus(sb *ipnstate.StatusBuilder, extraLocked func
s . TUN = ! b . sys . IsNetstack ( )
s . TUN = ! b . sys . IsNetstack ( )
s . BackendState = b . state . String ( )
s . BackendState = b . state . String ( )
s . AuthURL = b . authURLSticky
s . AuthURL = b . authURLSticky
if prefs := b . pm . CurrentPrefs ( ) ; prefs . Valid ( ) && prefs . AutoUpdate ( ) . Check {
s . ClientVersion = b . lastClientVersion
}
if err := health . OverallError ( ) ; err != nil {
if err := health . OverallError ( ) ; err != nil {
switch e := err . ( type ) {
switch e := err . ( type ) {
case multierr . Error :
case multierr . Error :
@ -2181,6 +2187,9 @@ func (b *LocalBackend) tellClientToBrowseToURL(url string) {
// onClientVersion is called on MapResponse updates when a MapResponse contains
// onClientVersion is called on MapResponse updates when a MapResponse contains
// a non-nil ClientVersion message.
// a non-nil ClientVersion message.
func ( b * LocalBackend ) onClientVersion ( v * tailcfg . ClientVersion ) {
func ( b * LocalBackend ) onClientVersion ( v * tailcfg . ClientVersion ) {
b . mu . Lock ( )
b . lastClientVersion = v
b . mu . Unlock ( )
switch runtime . GOOS {
switch runtime . GOOS {
case "darwin" , "ios" :
case "darwin" , "ios" :
// These auto-update well enough, and we haven't converted the
// These auto-update well enough, and we haven't converted the