tailcfg: add MapResponse.ControlTime field

And log it when provided in map responses.

The test uses the date on which I joined Tailscale. :)

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2022-02-16 18:36:04 -08:00
committed by Josh Bleecher Snyder
parent 72d8672ef7
commit 8cf6d0a17b
4 changed files with 29 additions and 1 deletions

View File

@@ -772,6 +772,9 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
go answerPing(c.logf, c.httpc, pr)
}
if !resp.ControlTime.IsZero() {
c.logf("netmap: control time is %v", resp.ControlTime.UTC().Format(time.RFC3339Nano))
}
if resp.KeepAlive {
vlogf("netmap: got keep-alive")
} else {