]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
fix mac address generation limitation
[pve-common.git] / src / PVE / Tools.pm
index 039c9fb8dae5e2d10cb492b9f41ecf4f08397a91..0d03b047624e0d3c668ba3fbd2c5fa19cf571050 100644 (file)
@@ -851,9 +851,9 @@ sub df {
     $pipe->reader();
 
     my $readvalues = sub {
-       $res->{total} = int(<$pipe>);
-       $res->{used}  = int(<$pipe>);
-       $res->{avail} = int(<$pipe>);
+       $res->{total} = int((<$pipe> =~ /^(\d*)$/)[0]);
+       $res->{used}  = int((<$pipe> =~ /^(\d*)$/)[0]);
+       $res->{avail} = int((<$pipe> =~ /^(\d*)$/)[0]);
     };
     eval {
        run_with_timeout($timeout, $readvalues);
@@ -983,7 +983,7 @@ sub random_ether_addr {
 
     my ($seconds, $microseconds) = gettimeofday;
 
-    my $rand = Digest::SHA::sha1_hex($$, rand(), $seconds, $microseconds);
+    my $rand = Digest::SHA::sha1($$, rand(), $seconds, $microseconds);
 
     # clear multicast, set local id
     vec($rand, 0, 8) = (vec($rand, 0, 8) & 0xfe) | 2;