summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2017-03-15 15:32:34 +0200
committerHanoh Haim <hhaim@cisco.com>2017-03-15 15:32:34 +0200
commitb27a3389455fe34dc2eed104985fffa21c3a69a7 (patch)
tree61c2a4cd37665a2da72f0f2b89571250ca739577
parent1d6f84e4a9f4360519d6213274303d13c02b4eb3 (diff)
parentf9b01d2d64a2902770a2d929cf4fbe1d83fa9588 (diff)
Merge branch 'master'
-rw-r--r--scripts/external_libs/scapy-2.3.1/python2/scapy/fields.py2
-rw-r--r--scripts/external_libs/scapy-2.3.1/python2/scapy/packet.py5
-rw-r--r--scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py3
-rw-r--r--scripts/external_libs/scapy-2.3.1/python3/scapy/packet.py4
4 files changed, 6 insertions, 8 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 ba65e63..8071670 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
@@ -34,7 +34,7 @@ class Field:
self.default = self.any2i(None,default)
self.sz = struct.calcsize(self.fmt)
self.owners = []
- self._offset =0;
+ self._offset = 0
def get_size_bytes (self):
if hasattr(self, 'size'):
diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/packet.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/packet.py
index 8cd78b8..b22305b 100644
--- a/scripts/external_libs/scapy-2.3.1/python2/scapy/packet.py
+++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/packet.py
@@ -320,8 +320,6 @@ class Packet(BasePacket):
def self_build(self, field_pos_list=None):
- #if self.raw_packet_cache is not None:
- # return self.raw_packet_cache
p=""
for f in self.fields_desc:
if type(p) is tuple :
@@ -339,7 +337,8 @@ class Packet(BasePacket):
f._offset= val
else:
p = f.addfield(self, p, val)
-
+ if self.raw_packet_cache is not None:
+ assert p == self.raw_packet_cache, 'Could not build the packet.'
return p
def do_build_payload(self):
diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
index 9dcebcf..a9e6613 100644
--- a/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
+++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/fields.py
@@ -34,8 +34,7 @@ class Field:
self.default = self.any2i(None,default)
self.sz = struct.calcsize(self.fmt)
self.owners = []
- self.offset =0;
- self._offset =0
+ self._offset = 0
def get_size_bytes (self):
diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/packet.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/packet.py
index 7e0a089..8401e0c 100644
--- a/scripts/external_libs/scapy-2.3.1/python3/scapy/packet.py
+++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/packet.py
@@ -338,8 +338,6 @@ class Packet(BasePacket, metaclass = Packet_metaclass):
print ("field %-40s %02d %02d" % (f.name, f._offset,f.get_size_bytes () ) );
def self_build(self, field_pos_list=None):
- #if self.raw_packet_cache is not None:
- # return self.raw_packet_cache
p=b""
for f in self.fields_desc:
#print(f.name)
@@ -359,6 +357,8 @@ class Packet(BasePacket, metaclass = Packet_metaclass):
f._offset= val
else:
p = f.addfield(self, p, val)
+ if self.raw_packet_cache is not None:
+ assert p == self.raw_packet_cache, 'Could not build the packet.'
return p
def do_build_payload(self):