From 8c6c6929267854ad7a314935c6ea05b0d845107a Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 3 Jul 2015 13:39:47 +0100 Subject: [PATCH] Seed the math/rand generator from the time --- ipam/ring/ring.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipam/ring/ring.go b/ipam/ring/ring.go index 1d55219e..2105939c 100644 --- a/ipam/ring/ring.go +++ b/ipam/ring/ring.go @@ -10,6 +10,7 @@ import ( "io" "math/rand" "sort" + "time" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/ipam/address" @@ -518,3 +519,7 @@ func (r *Ring) PeerNames() map[router.PeerName]struct{} { return res } + +func init() { + rand.Seed(time.Now().UTC().UnixNano()) +}