| ae6e3ea5 | 11-Oct-2023 |
Jose Luis Duran <[email protected]> |
ping: Require root user for pytests
atf_python may use vnet jails for creating an isolated test environment. Mark these tests that require root user privileges.
Reviewed by: markj MFC after: 1 week
ping: Require root user for pytests
atf_python may use vnet jails for creating an isolated test environment. Mark these tests that require root user privileges.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863
(cherry picked from commit 4efaf43c6fa76e0daa1ed5ea535d863f15415bf4)
show more ...
|
| a753d363 | 13-Apr-2023 |
Jose Luis Duran <[email protected]> |
ping: pr_iph() improvements
Very early on, the Src/Dst IP addresses were printed in hex notation (%08x), which will always be 8-characters wide. It was later changed to use a dot-decimal notation.
ping: pr_iph() improvements
Very early on, the Src/Dst IP addresses were printed in hex notation (%08x), which will always be 8-characters wide. It was later changed to use a dot-decimal notation. Depending on the IP address length, the Src and Dst headers may require a different padding. Use the source and destination IP lengths as padding for the headers.
Also, print an Opts (options) header, if there are options present. It has been abbreviated to Opts to match the length of the previous Data header, removed in ef9e6dc7eebe9830511602904d3ef5218d964080.
Print the header info such that no trailing spaces are produced. As some git workflows may automatically trim them, and make the tests fail (see 25b86f8559c2e7076daff56933217e95cd4398d4).
Before
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2␣
After
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2
And with options:
Before
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2 01...
After
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst Opts 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2 01...
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39561
(cherry picked from commit b86e4812cce88920cb592bd3b8571572373dbb9c)
show more ...
|
| 0c74823f | 10-Apr-2023 |
Jose Luis Duran <[email protected]> |
ping: Fix the spacing between the time stamp and cp/dp
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 wi
ping: Fix the spacing between the time stamp and cp/dp
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 ...
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39492
(cherry picked from commit 8db2c5802abe14543504e17ab5ed6325088a63f3)
show more ...
|
| e2c9158f | 21-Nov-2022 |
Jose Luis Duran <[email protected]> |
ping: Unify ping/ping6 statistics section
This is a first step towards a unification/simplification of ping/ping6 (internally). The end goal is to produce a standardized user-facing output.
Before
ping: Unify ping/ping6 statistics section
This is a first step towards a unification/simplification of ping/ping6 (internally). The end goal is to produce a standardized user-facing output.
Before (ping6):
PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms 16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms
--- 2001:db8::2 ping6 statistics --- round-trip min/avg/max/std-dev = 0.068/0.118/0.168/0.050 ms
After (ping6):
PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms 16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms
--- 2001:db8::2 ping statistics --- round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms
This has the nice side-effect of adding units to SIGINFO's statistics, as printing numbers without units may not be of much help. Also mentions the fact that these times are round-trip.
Before (ping/ping6 SIGINFO):
2/2 packets received (100.0%) 0.068 min / 0.118 avg / 0.168 max
After (ping/ping6 SIGINFO):
--- <ipv4/ipv6 address> ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms
In the case of a SIGINFO, the output will be printed to stderr, for both ping and ping6.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39126
(cherry picked from commit 03d4d1c778091a08277d070185a9c60c7a6d57e0)
show more ...
|
| b0da2a3f | 09-Feb-2023 |
Jose Luis Duran <[email protected]> |
ping: Remove an extra new line character
This matches the behavior when an RR truncated route is printed.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/p
ping: Remove an extra new line character
This matches the behavior when an RR truncated route is printed.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39485
(cherry picked from commit d2c9a140547acf1bfe3a233ef15cf971be93e14d)
show more ...
|
| 076b718d | 09-Feb-2023 |
Jose Luis Duran <[email protected]> |
ping tests: Add tests for IP header options
The function pr_pack() prints out a packet, if the IP packet contains options, these are printed as well.
Test the functionality fixed in 70960bb86a3ba5b
ping tests: Add tests for IP header options
The function pr_pack() prints out a packet, if the IP packet contains options, these are printed as well.
Test the functionality fixed in 70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1.
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38470
show more ...
|
| 1dc1f6bd | 09-Feb-2023 |
Jose Luis Duran <[email protected]> |
ping: Remove pr_retip()
Ping used to provide some sort of packet sniffing capabilities, this was in an era where hubs were used and tcpdump wasn't invented.
pr_iph() is a function that prints the I
ping: Remove pr_retip()
Ping used to provide some sort of packet sniffing capabilities, this was in an era where hubs were used and tcpdump wasn't invented.
pr_iph() is a function that prints the IP header of the packet.
pr_retip() is essentially a wrapper function to pr_iph(), that also displays the source and destination ports of a TCP or UDP packet.
After ef9e6dc7eebe9830511602904d3ef5218d964080 some of this functionality was almost removed, to only display packets sent by us (26+ years ago).
At this point, reaching this code path was only possible by doctoring the original packet.
After 46d7b45a267b3d78c5054b210ff7b6c55bfca42b this code path can never be reached.
Remove the code.
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38475
show more ...
|
| 9185854d | 14-Mar-2023 |
Jose Luis Duran <[email protected]> |
ping: Fix the display of Flags/Fragment Offset
In the IP header, Flags + Fragment Offset is a 16-bit field.
Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset values may not displa
ping: Fix the display of Flags/Fragment Offset
In the IP header, Flags + Fragment Offset is a 16-bit field.
Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset values may not display correctly.
Before (DF set)
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 0 0000 40 01 b6a4 192.0.2.1 192.0.2.2
After (DF set)
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38479
show more ...
|
| 5b8af90f | 20-Feb-2023 |
Jose Luis Duran <[email protected]> |
ping: Add ATF-Python tests
ping(8) is an old utility, which has received many changes and updates through the years. Some of these changes may have introduced small bugs, in part due to the lack of
ping: Add ATF-Python tests
ping(8) is an old utility, which has received many changes and updates through the years. Some of these changes may have introduced small bugs, in part due to the lack of tests. Attempt to remedy the current situation by introducing a way to easily add tests.
Differential Revision: https://reviews.freebsd.org/D38053
show more ...
|
| d481443a | 02-Nov-2022 |
Jose Luis Duran <[email protected]> |
ping_test: Fix tests ping_46 and ping6_46
If no IPv4-host, IPv4-mcast-group or IPv6-host is passed, it will display the usage. The tests are passing because they are just checking that the exit cod
ping_test: Fix tests ping_46 and ping6_46
If no IPv4-host, IPv4-mcast-group or IPv6-host is passed, it will display the usage. The tests are passing because they are just checking that the exit code is 1.
Fix the tests by checking the appropriate output message.
While here, change the description to match the output and add the missing requirements.
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37250
show more ...
|