summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2021-07-21 11:04:36 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2021-07-29 12:56:58 -0700
commit8a3d52e882c072d4bf581df2d83059d22674f53e (patch)
tree0b2ba67c5db30c67a8b76e53279880994838d67f /cmd
parentc2202cc27c568b522a458b29b876efa7b883de65 (diff)
downloadtailscale-8a3d52e882c072d4bf581df2d83059d22674f53e.tar.xz
tailscale-8a3d52e882c072d4bf581df2d83059d22674f53e.zip
wgengine/magicsock: use mono.Time
magicsock makes multiple calls to Now per packet. Move to mono.Now. Changing some of the calls to use package mono has a cascading effect, causing non-per-packet call sites to also switch. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tailscale/cli/status.go3
-rw-r--r--cmd/tailscale/depaware.txt1
-rw-r--r--cmd/tailscaled/depaware.txt2
3 files changed, 4 insertions, 2 deletions
diff --git a/cmd/tailscale/cli/status.go b/cmd/tailscale/cli/status.go
index 9ae378350..d6245947b 100644
--- a/cmd/tailscale/cli/status.go
+++ b/cmd/tailscale/cli/status.go
@@ -23,6 +23,7 @@ import (
"tailscale.com/ipn"
"tailscale.com/ipn/ipnstate"
"tailscale.com/net/interfaces"
+ "tailscale.com/tstime/mono"
"tailscale.com/util/dnsname"
)
@@ -193,7 +194,7 @@ func runStatus(ctx context.Context, args []string) error {
//
// TODO: have the server report this bool instead.
func peerActive(ps *ipnstate.PeerStatus) bool {
- return !ps.LastWrite.IsZero() && time.Since(ps.LastWrite) < 2*time.Minute
+ return !ps.LastWrite.IsZero() && mono.Since(ps.LastWrite) < 2*time.Minute
}
func dnsOrQuoteHostname(st *ipnstate.Status, ps *ipnstate.PeerStatus) string {
diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt
index dcc4b57bf..c0befd81f 100644
--- a/cmd/tailscale/depaware.txt
+++ b/cmd/tailscale/depaware.txt
@@ -49,6 +49,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
tailscale.com/syncs from tailscale.com/net/interfaces+
tailscale.com/tailcfg from tailscale.com/cmd/tailscale/cli+
W tailscale.com/tsconst from tailscale.com/net/interfaces
+ 💣 tailscale.com/tstime/mono from tailscale.com/cmd/tailscale/cli+
tailscale.com/types/empty from tailscale.com/ipn
tailscale.com/types/ipproto from tailscale.com/net/flowtrack+
tailscale.com/types/key from tailscale.com/derp+
diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt
index 1b13159ff..3460d2430 100644
--- a/cmd/tailscaled/depaware.txt
+++ b/cmd/tailscaled/depaware.txt
@@ -130,7 +130,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
tailscale.com/tailcfg from tailscale.com/control/controlclient+
W tailscale.com/tsconst from tailscale.com/net/interfaces
tailscale.com/tstime from tailscale.com/wgengine/magicsock
- 💣 tailscale.com/tstime/mono from tailscale.com/net/tstun
+ 💣 tailscale.com/tstime/mono from tailscale.com/net/tstun+
tailscale.com/types/empty from tailscale.com/control/controlclient+
tailscale.com/types/flagtype from tailscale.com/cmd/tailscaled
tailscale.com/types/ipproto from tailscale.com/net/flowtrack+