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

Philipp Marek philipp.marek at linbit.com
Wed Oct 7 13:06:24 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));
Yeah, guess so.




More information about the pve-devel mailing list