aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rwxr-xr-xresources/traffic_scripts/ipv4_sweep_ping.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/traffic_scripts/ipv4_sweep_ping.py b/resources/traffic_scripts/ipv4_sweep_ping.py
index 5005345250..6c18f795c2 100755
--- a/resources/traffic_scripts/ipv4_sweep_ping.py
+++ b/resources/traffic_scripts/ipv4_sweep_ping.py
@@ -93,8 +93,11 @@ def main():
if tmp.chksum != chksum:
raise RuntimeError(
'Invalid checksum {0} should be {1}'.format(chksum, tmp.chksum))
- recv_payload_len = ipv4.len - 20 - 8
- load = tmp['Raw'].load[0:recv_payload_len]
+
+ if 'Raw' in icmpv4:
+ load = icmpv4['Raw'].load
+ else:
+ load = []
if load != data[0:echo_seq]:
raise RuntimeError(
'Received ICMP payload does not match sent payload')