From bab9e29b6c465e1056265eab8bf2cfdcf3095762 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Wed, 14 Aug 2024 21:30:45 +0200 Subject: [PATCH] fix: used deprecated rand func --- proxmox/config_qemu.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox/config_qemu.go b/proxmox/config_qemu.go index 8fc5dc82..e997f8cd 100644 --- a/proxmox/config_qemu.go +++ b/proxmox/config_qemu.go @@ -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))