Skip to content
Snippets Groups Projects
Commit a7d199a9 authored by Daniel Jakots's avatar Daniel Jakots
Browse files

Fix IPv6 support on OpenBSD

parent 4c7a1405
No related branches found
No related tags found
No related merge requests found
...@@ -155,14 +155,30 @@ def in6_getifaddr(): ...@@ -155,14 +155,30 @@ def in6_getifaddr():
""" """
# List all network interfaces # List all network interfaces
try: if scapy.arch.OPENBSD:
f = os.popen("%s -l" % conf.prog.ifconfig) try:
except OSError,msg: f = os.popen("%s" % conf.prog.ifconfig)
log_interactive.warning("Failed to execute ifconfig.") except OSError,msg:
return [] 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 = [] ret = []
for i in splitted_line: for i in splitted_line:
ret += _in6_getifaddr(i) 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