Date: Wed, 28 Nov 2001 08:50:04 -0800 (PST) From: "Alexey V. Neyman" <alex.neyman@auriga.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/32354: ping -c 0 Message-ID: <200111281650.fASGo4Q68414@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/32354; it has been noted by GNATS.
From: "Alexey V. Neyman" <alex.neyman@auriga.ru>
To: setantae <setantae@submonkey.net>, 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111281650.fASGo4Q68414>
