summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
diff options
context:
space:
mode:
authorAnton Kiselev <anton.kisel@gmail.com>2016-11-18 13:50:35 +0700
committerAnton Kiselev <anton.kisel@gmail.com>2016-11-18 13:56:56 +0700
commitb75910ef6bb781b0d28eb253758bbe65d573b768 (patch)
tree2f331153d91ccc3f53698362c01ff8d53876956c /scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
parentae863c50263aa79391d4b81238c19a4b920ecc47 (diff)
scapy_service: take into account Ether.chksum when building payload with total_size
Signed-off-by: Anton Kiselev <anton.kisel@gmail.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
index 88514aa8..8d99fe92 100755
--- a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
+++ b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
@@ -468,7 +468,8 @@ class Scapy_service(Scapy_service_api):
gen.update(val)
total_sz = gen['total_size']
del gen['total_size']
- gen['size'] = total_sz - len(scapy_pkt)
+ ether_chksum_size_bytes = 4 # will be added outside of Scapy. needs to be excluded here
+ gen['size'] = total_sz - len(scapy_pkt) - ether_chksum_size_bytes
return generate_bytes(gen)
else:
return generate_bytes(val)