Page MenuHomeFreeBSD

ping: fix test timestamp_origin when tstamprepl is disabled
ClosedPublic

Authored by olivier on Thu, May 28, 12:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 20, 7:22 AM
Unknown Object (File)
Sun, Jun 14, 1:56 PM
Unknown Object (File)
Wed, Jun 10, 11:16 AM
Unknown Object (File)
Wed, Jun 10, 11:09 AM
Unknown Object (File)
Wed, Jun 10, 7:00 AM
Unknown Object (File)
Wed, Jun 10, 7:00 AM
Unknown Object (File)
Mon, Jun 8, 9:42 AM
Unknown Object (File)
Mon, Jun 8, 9:38 AM
Subscribers

Details

Summary

The timestamp_origin test sends an ICMP Timestamp Request (ping -Mt) and parses the tso/tsr fields out of the reply.
When the sysctl net.inet.icmp.tstamprepl is 0 (a common hardened default), the kernel silently drops the request, ping receives no reply, and the sed extraction yields an empty $tso. The test then fails inside atf_check test -n "$tso" with the unhelpful message

Test Plan

example:

$ sudo sysctl net.inet.icmp.tstamprepl=0
net.inet.icmp.tstamprepl: 1 -> 0
 $ sudo kyua test sbin/ping/ping_test:timestamp_origin
sbin/ping/ping_test:timestamp_origin  ->  passed  [0.026s]

Results file id is usr_tests.20260528-002128-026180
Results saved to /root/.kyua/store/results.usr_tests.20260528-002128-026180.db

1/1 passed (0 broken, 0 failed, 0 skipped)
$ sudo sysctl net.inet.icmp.tstamprepl
net.inet.icmp.tstamprepl: 0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olivier created this revision.

It looks good. Thank you!

This revision is now accepted and ready to land.Thu, May 28, 3:10 AM