]> git.proxmox.com Git - pve-common.git/commitdiff
improve random MAC address generation
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 22 Jan 2014 06:34:33 +0000 (07:34 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 22 Jan 2014 06:34:33 +0000 (07:34 +0100)
data/PVE/Tools.pm

index f8e9c4773dbe94ed7e57d1c9de5102d96410b85e..622f8ad02cd430763b5b577e6722436b8cc7489a 100644 (file)
@@ -882,7 +882,9 @@ sub decode_utf8_parameters {
 
 sub random_ether_addr {
 
 
 sub random_ether_addr {
 
-    my $rand = Digest::SHA::sha1_hex(rand(), time());
+    my ($seconds, $microseconds) = gettimeofday;
+
+    my $rand = Digest::SHA::sha1_hex($$, rand(), $seconds, $microseconds);
 
     my $mac = '';
     for (my $i = 0; $i < 6; $i++) {
 
     my $mac = '';
     for (my $i = 0; $i < 6; $i++) {