git: 8408510c7769 - main - ping: adjust error messages and comments for -gGh flags

From: Maxim Konovalov <maxim_at_FreeBSD.org>
Date: Sat, 28 Dec 2024 23:33:04 UTC
The branch main has been updated by maxim:

URL: https://cgit.FreeBSD.org/src/commit/?id=8408510c7769e5d78f882de9c7c30e93af25aedc

commit 8408510c7769e5d78f882de9c7c30e93af25aedc
Author:     Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2024-12-28 21:19:28 +0000
Commit:     Maxim Konovalov <maxim@FreeBSD.org>
CommitDate: 2024-12-28 23:32:32 +0000

    ping: adjust error messages and comments for -gGh flags
    
    The -gGh flags are used for sweep ping to specify minimal,
    maximum and increment sizes for the ICMP payload, not the packet
    size.  Adjust the error messages and comments accordingly.
    
    Reviewed by:    glebius
    
    Differential Revision: https://reviews.freebsd.org/D48232
---
 sbin/ping/ping.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index c11113fdd72d..2efe8d41f160 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -313,30 +313,30 @@ ping(int argc, char *const *argv)
 			options |= F_DOT;
 			setbuf(stdout, (char *)NULL);
 			break;
-		case 'G': /* Maximum packet size for ping sweep */
+		case 'G': /* Maximum payload size for ping sweep */
 			ltmp = strtonum(optarg, 1, INT_MAX, &errstr);
 			if (errstr != NULL) {
-				errx(EX_USAGE, "invalid packet size: `%s'",
+				errx(EX_USAGE, "invalid payload size: `%s'",
 				    optarg);
 			}
 			sweepmax = (int)ltmp;
 			if (uid != 0 && sweepmax > DEFDATALEN) {
 				errc(EX_NOPERM, EPERM,
-				    "packet size too large: %d > %u",
+				    "payload size too large: %d > %u",
 				    sweepmax, DEFDATALEN);
 			}
 			options |= F_SWEEP;
 			break;
-		case 'g': /* Minimum packet size for ping sweep */
+		case 'g': /* Minimum payload size for ping sweep */
 			ltmp = strtonum(optarg, 0, INT_MAX, &errstr);
 			if (errstr != NULL) {
-				errx(EX_USAGE, "invalid packet size: `%s'",
+				errx(EX_USAGE, "invalid payload size: `%s'",
 				    optarg);
 			}
 			sweepmin = (int)ltmp;
 			if (uid != 0 && sweepmin > DEFDATALEN) {
 				errc(EX_NOPERM, EPERM,
-				    "packet size too large: %d > %u",
+				    "payload size too large: %d > %u",
 				    sweepmin, DEFDATALEN);
 			}
 			options |= F_SWEEP;
@@ -344,16 +344,16 @@ ping(int argc, char *const *argv)
 		case 'H':
 			options |= F_HOSTNAME;
 			break;
-		case 'h': /* Packet size increment for ping sweep */
+		case 'h': /* Payload size increment for ping sweep */
 			ltmp = strtonum(optarg, 1, INT_MAX, &errstr);
 			if (errstr != NULL) {
-				errx(EX_USAGE, "invalid packet size: `%s'",
+				errx(EX_USAGE, "invalid payload size: `%s'",
 				    optarg);
 			}
 			sweepincr = (int)ltmp;
 			if (uid != 0 && sweepincr > DEFDATALEN) {
 				errc(EX_NOPERM, EPERM,
-				    "packet size too large: %d > %u",
+				    "payload size too large: %d > %u",
 				    sweepincr, DEFDATALEN);
 			}
 			options |= F_SWEEP;