diff options
author | Maxim Konovalov <maxim@FreeBSD.org> | 2024-12-28 21:19:28 +0000 |
---|---|---|
committer | Maxim Konovalov <maxim@FreeBSD.org> | 2024-12-28 23:32:32 +0000 |
commit | 8408510c7769e5d78f882de9c7c30e93af25aedc (patch) | |
tree | 55aade21f1974e57f0e16830859f212bf2baa3c7 | |
parent | 39d3c81c43c794aab00fbde9b4079749e6a08f6f (diff) |
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
-rw-r--r-- | sbin/ping/ping.c | 18 |
1 files 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; |