From 84c4bb50e13685176751e90bd67ce02730061032 Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Mon, 29 Feb 2016 09:40:27 +0100 Subject: Fix checksum comparison in latest code Change-Id: I8aa53ce64f8f9e0553702f8a586fac3824a876f4 Signed-off-by: Juraj Sloboda --- resources/traffic_scripts/ipv4_ping_ttl_check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'resources/traffic_scripts') 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)) -- cgit 1.2.3-korg