aboutsummaryrefslogtreecommitdiffstats
path: root/resources/traffic_scripts
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2016-02-29 09:40:27 +0100
committerJuraj Sloboda <jsloboda@cisco.com>2016-02-29 09:40:38 +0100
commit84c4bb50e13685176751e90bd67ce02730061032 (patch)
treed60309490ad97623ef719eb6051af9db0a7f0117 /resources/traffic_scripts
parentbc4d98a34af3f26a1c9264758186189f15513a7e (diff)
Fix checksum comparison in latest code
Change-Id: I8aa53ce64f8f9e0553702f8a586fac3824a876f4 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'resources/traffic_scripts')
-rwxr-xr-xresources/traffic_scripts/ipv4_ping_ttl_check.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/resources/traffic_scripts/ipv4_ping_ttl_check.py b/resources/traffic_scripts/ipv4_ping_ttl_check.py
index e6f5637cf9..99a7b0a5f0 100755
--- a/resources/traffic_scripts/ipv4_ping_ttl_check.py
+++ b/resources/traffic_scripts/ipv4_ping_ttl_check.py
@@ -15,7 +15,7 @@
from scapy.all import Ether, IP, ICMP
from resources.libraries.python.PacketVerifier \
- import Interface, create_gratuitous_arp_request, auto_pad
+ import Interface, create_gratuitous_arp_request, auto_pad, checksum_equal
from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
@@ -117,7 +117,7 @@ def main():
chksum = copy[IP].chksum
del copy[IP].chksum
tmp = IP(str(copy[IP]))
- if tmp.chksum != chksum:
+ if not checksum_equal(tmp.chksum, chksum):
raise RuntimeError('Received IPv4 packet contains invalid checksum, '
'{} instead of {}'.format(chksum, tmp.chksum))
@@ -131,7 +131,7 @@ def main():
chksum = copy[IP][ICMP].chksum
del copy[IP][ICMP].chksum
tmp = ICMP(str(copy[IP][ICMP]))
- if tmp.chksum != chksum:
+ if not checksum_equal(tmp.chksum, chksum):
raise RuntimeError('Received ICMP packet contains invalid checksum, '
'{} instead of {}'.format(chksum, tmp.chksum))