Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2024 12:52:45 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f3586d26936c - stable/14 - netpfil tests: skip checksum verification in pft_ping.py
Message-ID:  <202410211252.49LCqjpQ003557@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3586d26936cbcc5bc13c2c74c9224532e896d13

commit f3586d26936cbcc5bc13c2c74c9224532e896d13
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-10-14 12:57:49 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-10-21 12:51:36 +0000

    netpfil tests: skip checksum verification in pft_ping.py
    
    From scapy 2.6.0 it now removes (sets to None) the IP checksum in its defrag
    code. We typically ask for IPv4 or IPv6 defragmentation, which causes check
    function failures.
    
    Just skip the checksum verificiation here, because we're going to notice
    incorrect checksums even if the tests don't directly verify it.
    
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 6b8096fa5f6f81e2959cbb2ca857c4e134273da2)
---
 tests/sys/netpfil/common/pft_ping.py | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py
index 1abf4f609832..216db4ea6bfd 100644
--- a/tests/sys/netpfil/common/pft_ping.py
+++ b/tests/sys/netpfil/common/pft_ping.py
@@ -149,12 +149,6 @@ def check_ipv4(expect_params, packet):
     if dst_address and ip.dst != dst_address:
         LOGGER.debug('Destination IPv4 address does not match!')
         return False
-    chksum = ip.chksum
-    ip.chksum = None
-    new_chksum = sp.IP(sp.raw(ip)).chksum
-    if chksum != new_chksum:
-        LOGGER.debug(f'Expected IP checksum {new_chksum} but found {chksum}')
-        return False
     if flags and ip.flags != flags:
         LOGGER.debug(f'Wrong IP flags value {ip.flags}, expected {flags}')
         return False



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410211252.49LCqjpQ003557>