summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-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 = []