From 374d4b32631f9b16d0d2e417b6cb906bff0044c3 Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Sat, 26 Jun 2010 01:12:56 +0200 Subject: [PATCH] better hardware address generation --- tools/config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/config.py b/tools/config.py index 4459f66..1a98cb6 100755 --- a/tools/config.py +++ b/tools/config.py @@ -7,10 +7,12 @@ import re, sys, random # {0x79, 0x56, 0x34, 0x12} def rand_hw(): - res = ["0xFF"] - for i in range(3): - res.append(hex(random.randint(0, 255))) - return "{" + ",".join(res) + "}" + res = [] + for i in range(4): + res.append(random.randint(1, 254)) + #res.insert(0, random.randint(1, 254)) + res.sort(reverse=True) + return "{" + ",".join([hex(x) for x in res]) + "}" DATA = {