@ -417,16 +417,9 @@ func (b *LocalBackend) populatePeerStatusLocked(sb *ipnstate.StatusBuilder) {
if p . LastSeen != nil {
if p . LastSeen != nil {
lastSeen = * p . LastSeen
lastSeen = * p . LastSeen
}
}
var tailAddr4 string
var tailscaleIPs = make ( [ ] netaddr . IP , 0 , len ( p . Addresses ) )
var tailscaleIPs = make ( [ ] netaddr . IP , 0 , len ( p . Addresses ) )
for _ , addr := range p . Addresses {
for _ , addr := range p . Addresses {
if addr . IsSingleIP ( ) && tsaddr . IsTailscaleIP ( addr . IP ( ) ) {
if addr . IsSingleIP ( ) && tsaddr . IsTailscaleIP ( addr . IP ( ) ) {
if addr . IP ( ) . Is4 ( ) && tailAddr4 == "" {
// The peer struct previously only allowed a single
// Tailscale IP address. For compatibility for a few releases starting
// with 1.8, keep it pulled out as IPv4-only for a bit.
tailAddr4 = addr . IP ( ) . String ( )
}
tailscaleIPs = append ( tailscaleIPs , addr . IP ( ) )
tailscaleIPs = append ( tailscaleIPs , addr . IP ( ) )
}
}
}
}
@ -434,21 +427,20 @@ func (b *LocalBackend) populatePeerStatusLocked(sb *ipnstate.StatusBuilder) {
return r . Bits ( ) == 0
return r . Bits ( ) == 0
} )
} )
sb . AddPeer ( p . Key , & ipnstate . PeerStatus {
sb . AddPeer ( p . Key , & ipnstate . PeerStatus {
InNetworkMap : true ,
InNetworkMap : true ,
ID : p . StableID ,
ID : p . StableID ,
UserID : p . User ,
UserID : p . User ,
TailAddrDeprecated : tailAddr4 ,
TailscaleIPs : tailscaleIPs ,
TailscaleIPs : tailscaleIPs ,
HostName : p . Hostinfo . Hostname ,
HostName : p . Hostinfo . Hostname ,
DNSName : p . Name ,
DNSName : p . Name ,
OS : p . Hostinfo . OS ,
OS : p . Hostinfo . OS ,
KeepAlive : p . KeepAlive ,
KeepAlive : p . KeepAlive ,
Created : p . Created ,
Created : p . Created ,
LastSeen : lastSeen ,
LastSeen : lastSeen ,
Online : p . Online != nil && * p . Online ,
Online : p . Online != nil && * p . Online ,
ShareeNode : p . Hostinfo . ShareeNode ,
ShareeNode : p . Hostinfo . ShareeNode ,
ExitNode : p . StableID != "" && p . StableID == b . prefs . ExitNodeID ,
ExitNode : p . StableID != "" && p . StableID == b . prefs . ExitNodeID ,
ExitNodeOption : exitNodeOption ,
ExitNodeOption : exitNodeOption ,
} )
} )
}
}
}
}