tailcfg, control/controlclient: (mapver 16) add Node.Online, MapResponse.OnlineChange

And fix PeerSeenChange bug where it was ignored unless there were
other peer changes.

Updates tailscale/corp#1574

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-04-15 16:03:59 -07:00
committed by Brad Fitzpatrick
parent 7055f870f8
commit 670838c45f
6 changed files with 158 additions and 45 deletions
+5
View File
@@ -53,6 +53,10 @@ func (src *Node) Clone() *Node {
dst.LastSeen = new(time.Time)
*dst.LastSeen = *src.LastSeen
}
if dst.Online != nil {
dst.Online = new(bool)
*dst.Online = *src.Online
}
dst.Capabilities = append(src.Capabilities[:0:0], src.Capabilities...)
return dst
}
@@ -76,6 +80,7 @@ var _NodeNeedsRegeneration = Node(struct {
Hostinfo Hostinfo
Created time.Time
LastSeen *time.Time
Online *bool
KeepAlive bool
MachineAuthorized bool
Capabilities []string