Index: src/utils/uuid.py =================================================================== --- src/utils/uuid.py (revision 8104) +++ src/utils/uuid.py (working copy) @@ -179,7 +179,7 @@ if sys.platform == 'linux2': sfhd = socket.socket (socket.AF_INET, socket.SOCK_DGRAM) - ifreq = (interface + '\0' * 32) [:32] + ifreq = interface + '\0' * (32 - len(interface)) try: data = fcntl.ioctl (sfhd.fileno (), self.SIOCGIFHWADDR, ifreq) @@ -228,23 +228,17 @@ result = [] if sys.platform == 'linux2': - sfhd = socket.socket (socket.AF_INET, socket.SOCK_DGRAM) + f = open("/proc/net/dev") + iflist = f.readlines() + f.close() + for line in iflist: + if ':' not in line: + continue + words=string.split(line,':') + ifname, rest = words[0],words[1:] + ifname = string.strip(ifname) + result.append (ifname) - try: - buffer = array.array ('c', '\0' * 1024) - (addr, length) = buffer.buffer_info () - ifconf = struct.pack ("iP", length, addr) - data = fcntl.ioctl (sfhd.fileno (), self.SIOCGIFCONF, ifconf) - - size, ptr = struct.unpack ("iP", data) - for idx in range (0, size, 32): - ifconf = buffer.tostring () [idx:idx+32] - name = struct.unpack ("16s16s", ifconf) [0].split ('\0', 1) [0] - result.append (name) - - finally: - sfhd.close () - elif sys.platform == 'win32' and _HAS_GETOBJECT: result = [i for i in GetObject ('winmgmts:').ExecQuery ("SELECT * FROM " "Win32_NetworkAdapterConfiguration WHERE IPEnabled=True")]