$OpenBSD: patch-scapy_arch_unix_py,v 1.2 2016/01/31 23:21:37 sthen Exp $

Merged upstream
https://github.com/secdev/scapy/commit/3ecf379e52214aa742d09a15b13694e7d2c6d469

--- scapy/arch/unix.py.orig	Fri Jan 15 14:10:59 2016
+++ scapy/arch/unix.py	Sun Jan 24 11:03:12 2016
@@ -155,14 +155,30 @@ def in6_getifaddr():    
     """
 
     # List all network interfaces
-    try:
-	f = os.popen("%s -l" % conf.prog.ifconfig)
-    except OSError,msg:
-	log_interactive.warning("Failed to execute ifconfig.")
-	return []
+    if scapy.arch.OPENBSD:
+        try:
+            f = os.popen("%s" % conf.prog.ifconfig)
+        except OSError,msg:
+	    log_interactive.warning("Failed to execute ifconfig.")
+	    return []
 
-    # Get the list of network interfaces
-    splitted_line = f.readline().rstrip().split()
+        # Get the list of network interfaces
+        splitted_line = []
+        for l in f:
+            if "flags" in l:
+                iface = l.split()[0].rstrip(':')
+                splitted_line.append(iface)
+
+    else: # FreeBSD, NetBSD or Darwin
+        try:
+	    f = os.popen("%s -l" % conf.prog.ifconfig)
+        except OSError,msg:
+	    log_interactive.warning("Failed to execute ifconfig.")
+	    return []
+
+        # Get the list of network interfaces
+        splitted_line = f.readline().rstrip().split()
+
     ret = []
     for i in splitted_line:
 	ret += _in6_getifaddr(i)
