all: use math/rand/v2 more

Updates #11058

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2024-06-05 14:37:31 -07:00
committed by Maisem Ali
parent d2d459d442
commit 4a8cb1d9f3
23 changed files with 43 additions and 66 deletions

View File

@@ -22,7 +22,7 @@ import (
"log"
"math"
"math/big"
"math/rand"
"math/rand/v2"
"net"
"net/http"
"net/netip"
@@ -1514,7 +1514,7 @@ func (c *sclient) sendLoop(ctx context.Context) error {
}
}()
jitter := time.Duration(rand.Intn(5000)) * time.Millisecond
jitter := rand.N(5 * time.Second)
keepAliveTick, keepAliveTickChannel := c.s.clock.NewTicker(keepAlive + jitter)
defer keepAliveTick.Stop()