]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r350994, r350998, r351030, r351033, r351171, r351223, r351226, r351424
authorAlan Somers <asomers@FreeBSD.org>
Sun, 15 Sep 2019 16:53:02 +0000 (16:53 +0000)
committerAlan Somers <asomers@FreeBSD.org>
Sun, 15 Sep 2019 16:53:02 +0000 (16:53 +0000)
commit0f5c99fa9aaeda57d7b0ea2c05c0df8ff424cca5
tree1ecb99091755faf3984fb5647143cb338864193e
parent02f234f3b24884b48151036f4e493842e47700b0
MFC r350994, r350998, r351030, r351033, r351171, r351223, r351226, r351424

r350994:
ping: fix data type of a variable for a packet sequence number

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21244

r350998:
ping: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21245

r351030:
ping: fix triptime calculation after r350998

That revision changed the internal clock to the monotonic, but neglected to
change the datagram's timestamp source.

Reported by: Oliver Hartmann, Michael Butler
Reviewed by: Ján Sučan <sucanjan@gmail.com>, allanjude
MFC-With: r350998
Differential Revision: https://reviews.freebsd.org/D21258

r351033:
ping: Make in_cksum() operate on u_char buffer

This fixes -Wcast-align errors for in_cksum() calls when compiled with
WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21261

r351171:
ping: Move in_cksum() to a separate source file

This is a preparation step for adding ATF tests of in_cksum(), which has been
modified to operate on unaligned data. ping.o cannot be linked to the test
executable because both of them contain 'main' symbol.

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21288

r351223:
ping: fix -Wformat-truncating warning with GCC

Increase buffer size for the string representation of n_time

ICMP timestamp is a 32-bit number. In pr_ntime(), number of minutes
and seconds is always 2 characters wide. Max. number of hours is 4
characters wide. The buffer size should be at least:

4 + 2 + 2 + 1 (':') + 1 (':') + 1 ('\0') = 11

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21325

r351226:
Fix uninitialized variable warnings when MK_CASPER=no

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21322

r351424:
ping: fix include guard symbol name to reflect the header file name

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC-With: 351171
Sponsored by: Google LLC (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21374
sbin/ping/Makefile
sbin/ping/ping.c
sbin/ping/utils.c [new file with mode: 0644]
sbin/ping/utils.h [new file with mode: 0644]