summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-15 16:19:13 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-15 16:19:13 +0200
commit9de939585468e18c6aa57f626530841029bb7e86 (patch)
treeeea2ca6517dc91a6382462e12f5b5bf049dd108e /scripts
parentd354934b8d6aeef4f0329a4460d57328e8a4ed6a (diff)
building native code: remove checksum fields
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
index b1bde030..2baa645c 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
@@ -508,7 +508,13 @@ class STLStream(object):
def to_code (self):
""" convert to Python code as profile """
packet = Ether(self.pkt)
- packet.hide_defaults()
+ layer = packet
+ while layer: # remove checksums
+ for chksum_name in ('cksum', 'chksum'):
+ if chksum_name in layer.fields:
+ del layer.fields[chksum_name]
+ layer = layer.payload
+ packet.hide_defaults() # remove fields with default values
payload = packet.getlayer('Raw')
packet_command = packet.command()
imports_arr = []