The branch main has been updated by maxim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=39d3c81c43c794aab00fbde9b4079749e6a08f6f

commit 39d3c81c43c794aab00fbde9b4079749e6a08f6f
Author:     Maxim Konovalov <ma...@freebsd.org>
AuthorDate: 2024-12-28 21:10:04 +0000
Commit:     Maxim Konovalov <ma...@freebsd.org>
CommitDate: 2024-12-28 23:32:31 +0000

    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
---
 sbin/ping/ping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);

Reply via email to