Skip to content

Commit

Permalink
fix: used deprecated rand func
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinyblargon committed Aug 14, 2024
1 parent 1b084ee commit bab9e29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proxmox/config_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,8 @@ func (c ConfigQemu) CreateQemuNetworksParams(params map[string]interface{}) {
case nil, "":
// Generate random Mac based on time
macaddr := make(net.HardwareAddr, 6)
rand.Seed(time.Now().UnixNano())
rand.Read(macaddr)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
r.Read(macaddr)
macaddr[0] = (macaddr[0] | 2) & 0xfe // fix from github issue #18
macAddr = strings.ToUpper(fmt.Sprintf("%v", macaddr))

Expand Down

0 comments on commit bab9e29

Please sign in to comment.