Skip to content
Snippets Groups Projects
Commit 87073693 authored by Pierre LALET's avatar Pierre LALET
Browse files

Fix missing/incorrect imports

parent 2fc18534
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ if not hasattr(socket, 'IPPROTO_GRE'): ...@@ -43,7 +43,7 @@ if not hasattr(socket, 'IPPROTO_GRE'):
from scapy.arch import pcapdnet from scapy.arch import pcapdnet
from scapy.arch.pcapdnet import * from scapy.arch.pcapdnet import *
from scapy.consts import LOOPBACK_NAME import scapy.consts
def is_new_release(ignoreVBS=False): def is_new_release(ignoreVBS=False):
if NEW_RELEASE and conf.prog.powershell is not None: if NEW_RELEASE and conf.prog.powershell is not None:
...@@ -348,7 +348,7 @@ class NetworkInterface(object): ...@@ -348,7 +348,7 @@ class NetworkInterface(object):
try: try:
if not self.ip: if not self.ip:
self.ip=get_ip_from_name(data['name']) self.ip=get_ip_from_name(data['name'])
if not self.ip and self.name == LOOPBACK_NAME: if not self.ip and self.name == scapy.consts.LOOPBACK_NAME:
self.ip = "127.0.0.1" self.ip = "127.0.0.1"
if not self.ip: if not self.ip:
# No IP detected # No IP detected
...@@ -456,7 +456,9 @@ class NetworkInterfaceDict(UserDict): ...@@ -456,7 +456,9 @@ class NetworkInterfaceDict(UserDict):
self.remove_invalid_ifaces() self.remove_invalid_ifaces()
# Replace LOOPBACK_INTERFACE # Replace LOOPBACK_INTERFACE
try: try:
scapy.consts.LOOPBACK_INTERFACE = self.dev_from_name(LOOPBACK_NAME) scapy.consts.LOOPBACK_INTERFACE = self.dev_from_name(
scapy.consts.LOOPBACK_NAME,
)
except: except:
pass pass
...@@ -683,7 +685,7 @@ def in6_getifaddr(): ...@@ -683,7 +685,7 @@ def in6_getifaddr():
def _append_route6(routes, dpref, dp, nh, iface, lifaddr): def _append_route6(routes, dpref, dp, nh, iface, lifaddr):
cset = [] # candidate set (possible source addresses) cset = [] # candidate set (possible source addresses)
if iface.name == LOOPBACK_NAME: if iface.name == scapy.consts.LOOPBACK_NAME:
if dpref == '::': if dpref == '::':
return return
cset = ['::1'] cset = ['::1']
......
...@@ -15,6 +15,7 @@ import socket ...@@ -15,6 +15,7 @@ import socket
import struct import struct
from scapy.config import conf from scapy.config import conf
import scapy.consts
from scapy.data import * from scapy.data import *
from scapy.utils import * from scapy.utils import *
from scapy.pton_ntop import * from scapy.pton_ntop import *
......
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