aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Konovalov <maxim@FreeBSD.org>2024-12-28 21:10:04 +0000
committerMaxim Konovalov <maxim@FreeBSD.org>2024-12-28 23:32:31 +0000
commit39d3c81c43c794aab00fbde9b4079749e6a08f6f (patch)
tree3ccede273854553a19046b1f189626d14d3c5a49
parent295934eaa92cd917ae42a446899c0d527ad9c0c9 (diff)
ping: correct minimal payload size for the sweep ping
The -g flag specifies a minimal payload size for the sweep ping and its default is zero. Make it possible to do ping -g 0 ..., i.e., start with no payload. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D48231
-rw-r--r--sbin/ping/ping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index d9d544bc75c8..c11113fdd72d 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -328,7 +328,7 @@ ping(int argc, char *const *argv)
options |= F_SWEEP;
break;
case 'g': /* Minimum packet size for ping sweep */
- ltmp = strtonum(optarg, 1, INT_MAX, &errstr);
+ ltmp = strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr != NULL) {
errx(EX_USAGE, "invalid packet size: `%s'",
optarg);