Skip to content

Commit

Permalink
ping tests: Fix test on i386 platforms
Browse files Browse the repository at this point in the history
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:		5b8af90 ("ping: Add ATF-Python tests")
Pull Request:	#874
Differential Revision: https://reviews.freebsd.org/D42268

(cherry picked from commit 24fe0cb)
  • Loading branch information
jlduran authored and markjdb committed Nov 3, 2023
1 parent 098273e commit f790f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sbin/ping/tests/test_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f790f28

Please sign in to comment.