diff options
author | 2016-10-27 11:43:17 +0300 | |
---|---|---|
committer | 2016-10-27 11:43:45 +0300 | |
commit | 6cf5aa4153da4874a22af51f96d0029f73979460 (patch) | |
tree | 689f72075d0cd921231ae9325d371dd5161358b2 /scripts/external_libs/scapy-2.3.1/python2/scapy | |
parent | 1782ef7a71c3e031fc5d1343c27ed2c8e45fd4ad (diff) |
fix scapy_service ARP issue and add more layers in the service
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
Diffstat (limited to 'scripts/external_libs/scapy-2.3.1/python2/scapy')
-rw-r--r-- | scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py | 4 | ||||
-rw-r--r-- | scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py | 35 |
2 files changed, 1 insertions, 38 deletions
diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py index 8bb8c970..df85875a 100644 --- a/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py +++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py @@ -242,9 +242,7 @@ class SourceIPField(IPField): self.dstname = dstname def i2m(self, pkt, x): if x is None: - iff,x,gw = pkt.route() - if x is None: - x = "0.0.0.0" + x="16.0.0.1" return IPField.i2m(self, pkt, x) def i2h(self, pkt, x): if x is None: diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py index 3f80ed7d..bb093042 100644 --- a/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py +++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/layers/l2.py @@ -84,49 +84,14 @@ def getmacbyip(ip, chainCC=0): class DestMACField(MACField): def __init__(self, name): MACField.__init__(self, name, None) - def i2h(self, pkt, x): - if x is None: - x = conf.neighbor.resolve(pkt,pkt.payload) - if x is None: - x = "ff:ff:ff:ff:ff:ff" - warning("Mac address to reach destination not found. Using broadcast.") - return MACField.i2h(self, pkt, x) - def i2m(self, pkt, x): - return MACField.i2m(self, pkt, self.i2h(pkt, x)) class SourceMACField(MACField): def __init__(self, name): MACField.__init__(self, name, None) - def i2h(self, pkt, x): - if x is None: - iff,a,gw = pkt.payload.route() - if iff: - try: - x = get_if_hwaddr(iff) - except: - pass - if x is None: - x = "00:00:00:00:00:00" - return MACField.i2h(self, pkt, x) - def i2m(self, pkt, x): - return MACField.i2m(self, pkt, self.i2h(pkt, x)) class ARPSourceMACField(MACField): def __init__(self, name): MACField.__init__(self, name, None) - def i2h(self, pkt, x): - if x is None: - iff,a,gw = pkt.route() - if iff: - try: - x = get_if_hwaddr(iff) - except: - pass - if x is None: - x = "00:00:00:00:00:00" - return MACField.i2h(self, pkt, x) - def i2m(self, pkt, x): - return MACField.i2m(self, pkt, self.i2h(pkt, x)) |