Page MenuHomeFreeBSD

ping: Fix the spacing between the time stamp and cp/dp
ClosedPublic

Authored by jlduran on Apr 10 2023, 6:33 PM.
Tags
None
Referenced Files
F163562300: D39492.id120111.diff
Fri, Jul 24, 12:47 PM
Unknown Object (File)
Thu, Jul 23, 9:24 AM
Unknown Object (File)
Wed, Jul 22, 4:48 PM
Unknown Object (File)
Sat, Jul 18, 4:59 AM
Unknown Object (File)
Jun 23 2026, 9:01 AM
Unknown Object (File)
Jun 23 2026, 6:59 AM
Unknown Object (File)
Jun 22 2026, 7:32 PM
Unknown Object (File)
Jun 21 2026, 11:47 PM

Details

Summary

When an echo reply packet is received, the data is compared with the sent data. When a wrong byte is detected the command displays a report with the differences.
The first row (the first 8-bytes of data after the ICMP header) should include the time stamp (if data is at least 8-bytes), this value is not taken into consideration for the comparison. The remaining rows represent the data (padded pattern) received/sent, with each byte being compared for differences.
Print the space before (not after), to add an extra space after cp:/dp: for better readability when the first time stamp octet is not zero-padded, and to remove trailing spaces in the output.
Before:

cp:99  0  0  c  1  5  c  0␣
    ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd␣
    ...

After:

cp: 99  0  0  c  1  5  c  0
     ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd
     ...
Test Plan
kyua debug -k /usr/tests/Kyuafile sbin/ping/test_ping.py:TestPing::test_pinger[_0_0_special_wrong]

Diff Detail

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