From a6845bd0dd8cf34f0e62d7484267e7c581815af0 Mon Sep 17 00:00:00 2001
From: Josh Blum <josh@joshknows.com>
Date: Wed, 9 May 2012 18:29:48 -0700
Subject: n2xx: fix possible attribute error in netburner win_get_interfaces

It is possible on some machines (at least one in this case),
for adNode to not have the attribute next. Unexplained...
This may be a fix, and if not, should be harmless.
---
 host/utils/usrp_n2xx_net_burner.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/host/utils/usrp_n2xx_net_burner.py b/host/utils/usrp_n2xx_net_burner.py
index 835ab696f..f38a72fa1 100755
--- a/host/utils/usrp_n2xx_net_burner.py
+++ b/host/utils/usrp_n2xx_net_burner.py
@@ -205,9 +205,9 @@ def win_get_interfaces():
                     hexMask = struct.unpack("<L", socket.inet_aton(ipMask))[0]
                     if(hexAddr and hexMask): #don't broadcast on 255.255.255.255, that's just lame
                         yield socket.inet_ntoa(struct.pack("<L", (hexAddr & hexMask) | (~hexMask) & 0xFFFFFFFF))
-                adNode = adNode.next
-                if not adNode:
-                    break
+                try: adNode = adNode.next
+                except: break
+                if not adNode: break
 
 def enumerate_devices():
     for bcast_addr in get_interfaces():
-- 
cgit v1.2.3