summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2023-08-16 15:23:40 -0700
committerBrad Fitzpatrick <bradfitz@tailscale.com>2023-08-16 15:23:43 -0700
commitb256c319c08c50bd52e617c500a37e566fbbb432 (patch)
tree5d5ee711ff693b81ac0a2f0fbff70c9c5cd4c929 /control/controlclient
parent57da1f150199957fbb3659df3a607cfb2af74317 (diff)
downloadtailscale-bradfitz/gui_netmap.tar.xz
tailscale-bradfitz/gui_netmap.zip
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlclient')
-rw-r--r--control/controlclient/direct.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go
index 1762c4eec..4f98fbf9b 100644
--- a/control/controlclient/direct.go
+++ b/control/controlclient/direct.go
@@ -1110,6 +1110,16 @@ func (c *Direct) sendMapRequest(ctx context.Context, isStreaming bool, nu Netmap
}
nm := sess.netmapForResponse(&resp)
+
+ // Occasionally print the netmap header.
+ // This is handy for debugging, and our logs processing
+ // pipeline depends on it. (TODO: Remove this dependency.)
+ // Code elsewhere prints netmap diffs every time they are received.
+ now := c.clock.Now()
+ if now.Sub(c.lastPrintMap) >= 5*time.Minute {
+ c.lastPrintMap = now
+ c.logf("[v1] new network map[%d]:\n%s", i, nm.VeryConcise())
+ }
if nm.SelfNode == nil {
c.logf("MapResponse lacked node")
return errors.New("MapResponse lacked node")
@@ -1129,15 +1139,6 @@ func (c *Direct) sendMapRequest(ctx context.Context, isStreaming bool, nu Netmap
nm.SelfNode.Capabilities = nil
}
- // Occasionally print the netmap header.
- // This is handy for debugging, and our logs processing
- // pipeline depends on it. (TODO: Remove this dependency.)
- // Code elsewhere prints netmap diffs every time they are received.
- now := c.clock.Now()
- if now.Sub(c.lastPrintMap) >= 5*time.Minute {
- c.lastPrintMap = now
- c.logf("[v1] new network map[%d]:\n%s", i, nm.VeryConcise())
- }
newPersist := persist.AsStruct()
newPersist.NodeID = nm.SelfNode.StableID
newPersist.UserProfile = nm.UserProfiles[nm.User]