Locally administered mac addresses have the second least significant bit of the most significant byte set. If this byte is set then udev on ubuntu doesn't set persistent net rules.

This patch changes the generate_mac to generate a locally administered mac address.
This commit is contained in:
Vishvananda Ishaya 2010-07-21 02:32:32 +00:00 committed by Tarmac
commit 2812f98022

View File

@ -94,7 +94,7 @@ def generate_uid(topic, size=8):
def generate_mac():
mac = [0x00, 0x16, 0x3e, random.randint(0x00, 0x7f),
mac = [0x02, 0x16, 0x3e, random.randint(0x00, 0x7f),
random.randint(0x00, 0xff), random.randint(0x00, 0xff)
]
return ':'.join(map(lambda x: "%02x" % x, mac))