From owner-freebsd-bugs Wed Nov 28 8:50:26 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 38FCD37B41C for ; Wed, 28 Nov 2001 08:50:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fASGo4Q68414; Wed, 28 Nov 2001 08:50:04 -0800 (PST) (envelope-from gnats) Date: Wed, 28 Nov 2001 08:50:04 -0800 (PST) Message-Id: <200111281650.fASGo4Q68414@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Alexey V. Neyman" Subject: Re: bin/32354: ping -c 0 Reply-To: "Alexey V. Neyman" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/32354; it has been noted by GNATS. From: "Alexey V. Neyman" To: setantae , bug-followup@FreeBSD.org, roam@ringlet.net Cc: Subject: Re: bin/32354: ping -c 0 Date: Wed, 28 Nov 2001 19:43:37 +0300 hi, there! On 28 November 2001 19:10, setantae wrote: > rhadamanth# ping -l 5 -c 5 archaia > PING archaia.private.submonkey.net. (192.168.10.2): 56 data bytes > 64 bytes from 192.168.10.2: icmp_seq=0 ttl=255 time=1.387 ms > 64 bytes from 192.168.10.2: icmp_seq=1 ttl=255 time=1.566 ms > 64 bytes from 192.168.10.2: icmp_seq=2 ttl=255 time=1.882 ms > 64 bytes from 192.168.10.2: icmp_seq=3 ttl=255 time=2.110 ms > 64 bytes from 192.168.10.2: icmp_seq=4 ttl=255 time=2.406 ms > > --- archaia.private.submonkey.net. ping statistics --- > 6 packets transmitted, 5 packets received, 16% packet loss Doesn't the line above warn you? It says that it has transmitted 6 (not 5, as it was requested) packets - an thus disobeys its orders :) IMO this should be in ping.c: --- ping.c Tue Oct 30 17:08:33 2001 +++ ping.c Wed Nov 28 22:36:10 2001 @@ -397,6 +397,9 @@ } } + if (preload > npackets) + errx(EX_USAGE, "preload(%d) > count(%ld)", preload, npackets); + if (argc - optind != 1) usage(); target = argv[optind]; @@ -631,8 +634,10 @@ intvl.tv_usec = interval % 1000 * 1000; } - pinger(); /* send the first ping */ - (void)gettimeofday(&last, NULL); + if (ntransmitted < npackets) { + pinger(); /* send the first ping */ + (void)gettimeofday(&last, NULL); + } while (!finish_up) { register int cc; <-------------------------> ) May the Sun and Water ( Regards, Alexey V. Neyman ) always fall upon you! ( mailto:alex.neyman@auriga.ru <-------------------------> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message