Skip to content
Snippets Groups Projects
Commit 3ecf379e authored by Pierre Lalet's avatar Pierre Lalet
Browse files

Merge pull request #29 from danieljakots/master

Fix IPv6 support on OpenBSD
parents 746cbd99 a7d199a9
No related branches found
No related tags found
No related merge requests found
......@@ -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 = []
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()
# Get the list of network interfaces
splitted_line = f.readline().rstrip().split()
ret = []
for i in splitted_line:
ret += _in6_getifaddr(i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment