From 87073693512341bcc2e2b8ece6d4b6b9676030a2 Mon Sep 17 00:00:00 2001
From: Pierre LALET <pierre.lalet@cea.fr>
Date: Thu, 24 Aug 2017 07:21:27 +0200
Subject: [PATCH] Fix missing/incorrect imports

---
 scapy/arch/windows/__init__.py | 10 ++++++----
 scapy/utils6.py                |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/scapy/arch/windows/__init__.py b/scapy/arch/windows/__init__.py
index 43614e40..ade8935f 100755
--- a/scapy/arch/windows/__init__.py
+++ b/scapy/arch/windows/__init__.py
@@ -43,7 +43,7 @@ if not hasattr(socket, 'IPPROTO_GRE'):
 from scapy.arch import pcapdnet
 from scapy.arch.pcapdnet import *
 
-from scapy.consts import LOOPBACK_NAME
+import scapy.consts
 
 def is_new_release(ignoreVBS=False):
     if NEW_RELEASE and conf.prog.powershell is not None:
@@ -348,7 +348,7 @@ class NetworkInterface(object):
         try:
             if not self.ip:
                 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"
             if not self.ip:
                 # No IP detected
@@ -456,7 +456,9 @@ class NetworkInterfaceDict(UserDict):
             self.remove_invalid_ifaces()
             # Replace LOOPBACK_INTERFACE
             try:
-                scapy.consts.LOOPBACK_INTERFACE = self.dev_from_name(LOOPBACK_NAME)
+                scapy.consts.LOOPBACK_INTERFACE = self.dev_from_name(
+                    scapy.consts.LOOPBACK_NAME,
+                )
             except:
                 pass
 
@@ -683,7 +685,7 @@ def in6_getifaddr():
 
 def _append_route6(routes, dpref, dp, nh, iface, lifaddr):
     cset = [] # candidate set (possible source addresses)
-    if iface.name == LOOPBACK_NAME:
+    if iface.name == scapy.consts.LOOPBACK_NAME:
         if dpref == '::':
             return
         cset = ['::1']
diff --git a/scapy/utils6.py b/scapy/utils6.py
index 0759d644..31bdb66c 100644
--- a/scapy/utils6.py
+++ b/scapy/utils6.py
@@ -15,6 +15,7 @@ import socket
 import struct
 
 from scapy.config import conf
+import scapy.consts
 from scapy.data import *
 from scapy.utils import *
 from scapy.pton_ntop import *
-- 
GitLab