mirror of https://github.com/secdev/scapy.git
Merge pull request #303 from guedou/Issue_#301
Travis fails on OS X with pcap & dnet modules
This commit is contained in:
commit
923e8d1816
|
@ -18,6 +18,7 @@ from scapy.plist import SndRcvList
|
||||||
from scapy.fields import *
|
from scapy.fields import *
|
||||||
from scapy.sendrecv import *
|
from scapy.sendrecv import *
|
||||||
from scapy.arch import get_if_hwaddr
|
from scapy.arch import get_if_hwaddr
|
||||||
|
from scapy.arch.consts import LOOPBACK_NAME
|
||||||
from scapy.utils import inet_ntoa, inet_aton
|
from scapy.utils import inet_ntoa, inet_aton
|
||||||
if conf.route is None:
|
if conf.route is None:
|
||||||
# unused import, only to initialize conf.route
|
# unused import, only to initialize conf.route
|
||||||
|
@ -61,7 +62,7 @@ def getmacbyip(ip, chainCC=0):
|
||||||
if (tmp[0] & 0xf0) == 0xe0: # mcast @
|
if (tmp[0] & 0xf0) == 0xe0: # mcast @
|
||||||
return "01:00:5e:%.2x:%.2x:%.2x" % (tmp[1]&0x7f,tmp[2],tmp[3])
|
return "01:00:5e:%.2x:%.2x:%.2x" % (tmp[1]&0x7f,tmp[2],tmp[3])
|
||||||
iff,a,gw = conf.route.route(ip)
|
iff,a,gw = conf.route.route(ip)
|
||||||
if ( (iff == "lo") or (ip == conf.route.get_if_bcast(iff)) ):
|
if ( (iff == LOOPBACK_NAME) or (ip == conf.route.get_if_bcast(iff)) ):
|
||||||
return "ff:ff:ff:ff:ff:ff"
|
return "ff:ff:ff:ff:ff:ff"
|
||||||
if gw != "0.0.0.0":
|
if gw != "0.0.0.0":
|
||||||
ip = gw
|
ip = gw
|
||||||
|
|
Loading…
Reference in New Issue