[virt-tools-list] random MAC generation and top bit?

John Levon levon at movementarian.org
Mon Nov 30 15:24:50 UTC 2009


    mac = oui + [
            random.randint(0x00, 0x7f),
            random.randint(0x00, 0xff),
            random.randint(0x00, 0xff) ]
    return ':'.join(map(lambda x: "%02x" % x, mac))

Why the 0x7f?

thanks
john




More information about the virt-tools-list mailing list