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
+2 -2
View File
@@ -10,7 +10,7 @@ import (
"errors"
"fmt"
"math"
"math/rand"
"math/rand/v2"
"net"
"net/netip"
"reflect"
@@ -592,7 +592,7 @@ func (de *endpoint) addrForWireGuardSendLocked(now mono.Time) (udpAddr netip.Add
// Randomly select an address to use until we retrieve latency information
// and give it a short trustBestAddrUntil time so we avoid flapping between
// addresses while waiting on latency information to be populated.
udpAddr = candidates[rand.Intn(len(candidates))]
udpAddr = candidates[rand.IntN(len(candidates))]
}
de.bestAddr.AddrPort = udpAddr