]> git.proxmox.com Git - pve-common.git/blobdiff - data/PVE/Tools.pm
correctly copy bridge config
[pve-common.git] / data / PVE / Tools.pm
index f399d77dbb4541116bb4ea68adf112cc6e46c79d..622f8ad02cd430763b5b577e6722436b8cc7489a 100644 (file)
@@ -729,6 +729,10 @@ sub next_vnc_port {
     return next_unused_port(5900, 6000);
 }
 
+sub next_spice_port {
+    return next_unused_port(61000, 61099);
+}
+
 # NOTE: NFS syscall can't be interrupted, so alarm does 
 # not work to provide timeouts.
 # from 'man nfs': "Only SIGKILL can interrupt a pending NFS operation"
@@ -878,7 +882,9 @@ sub decode_utf8_parameters {
 
 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++) {