Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Nov 2023 13:31:09 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f790f2809202 - stable/14 - ping tests: Fix test on i386 platforms
Message-ID:  <202311031331.3A3DV9TT025237@gitrepo.freebsd.org>

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

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

commit f790f2809202389eee7750eb160491d44449d3ef
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2023-10-17 11:35:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-11-03 13:30:58 +0000

    ping tests: Fix test on i386 platforms
    
    Actually use INT_MAX (0x7fffffff), not UINT_MAX (0xffffffff) to avoid
    overflowing time_t and missing the test.
    
    Reported by:    Jenkins
    Reviewed by:    markj
    Fixes:          5b8af90fe332 ("ping: Add ATF-Python tests")
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/874
    Differential Revision: https://reviews.freebsd.org/D42268
    
    (cherry picked from commit 24fe0cb84d71a0e9d648c43f92b5c3a730c3855a)
---
 sbin/ping/tests/test_ping.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 26a69b62f8fb..b501b8a606bf 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -51,7 +51,7 @@ def build_response_packet(echo, ip, icmp, oip_ihl, special):
         # Build a package with a timestamp of INT_MAX
         # (time-warped package)
         payload_no_timestamp = sc.bytes_hex(load)[16:]
-        load = (b"\xff" * 8) + sc.hex_bytes(payload_no_timestamp)
+        load = b"\x7f" + (b"\xff" * 7) + sc.hex_bytes(payload_no_timestamp)
     if special == "wrong":
         # Build a package with a wrong last byte
         payload_no_last_byte = sc.bytes_hex(load)[:-2]



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