[pve-devel] [PATCH] Shorter implementation of random_ether_addr().

Dietmar Maurer dietmar at proxmox.com
Wed Oct 7 12:58:35 CEST 2015


First, many thanks for the patch!

> +    my $mac = sprintf("%02X:" x 6, unpack("C6", $rand));
> +
> +# remove superfluous ":" at end
> +    chop($mac);

I wonder if it would be simpler to use a static format string instead?

    my $mac = sprintf("%02X:%02X:%02X:%02X:%02X:%02X", unpack("C6", $rand));



More information about the pve-devel mailing list