mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-08 04:59:17 +00:00
random_ether_addr: code cleanups
This commit is contained in:
parent
de9a267fec
commit
85d5625a15
@ -943,12 +943,7 @@ sub random_ether_addr {
|
|||||||
# clear multicast, set local id
|
# clear multicast, set local id
|
||||||
vec($rand, 0, 8) = (vec($rand, 0, 8) & 0xfe) | 2;
|
vec($rand, 0, 8) = (vec($rand, 0, 8) & 0xfe) | 2;
|
||||||
|
|
||||||
my $mac = sprintf("%02X:" x 6, unpack("C6", $rand));
|
return sprintf("%02X:%02X:%02X:%02X:%02X:%02X", unpack("C6", $rand));
|
||||||
|
|
||||||
# remove superfluous ":" at end
|
|
||||||
chop($mac);
|
|
||||||
|
|
||||||
return $mac;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub shellquote {
|
sub shellquote {
|
||||||
|
Loading…
Reference in New Issue
Block a user