Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1068 from weaveworks/1004-seed-random
Browse files Browse the repository at this point in the history
Seed random-number generator from the host time

Fixes #1004.
  • Loading branch information
rade committed Jul 3, 2015
2 parents b72b7a9 + 8c6c692 commit 1524796
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ipam/ring/ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"io"
"math/rand"
"sort"
"time"

"github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/ipam/address"
Expand Down Expand Up @@ -518,3 +519,7 @@ func (r *Ring) PeerNames() map[router.PeerName]struct{} {

return res
}

func init() {
rand.Seed(time.Now().UTC().UnixNano())
}

0 comments on commit 1524796

Please sign in to comment.