summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-07-09 20:33:58 +0000
committerjulian <julian@FreeBSD.org>1997-07-09 20:33:58 +0000
commit7b9a0408f220c6265de916935dfbb18b2000ff4d (patch)
tree3e5315d6d3c974d966be34995841342742931663 /sbin
parent95c4ece8942ad17e66c6e25afc3d712d89b05a5c (diff)
downloadFreeBSD-src-7b9a0408f220c6265de916935dfbb18b2000ff4d.zip
FreeBSD-src-7b9a0408f220c6265de916935dfbb18b2000ff4d.tar.gz
don't count packets as being transmitted when we know that the sendto()
failed (e.g. ENOBUFS)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ping/ping.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index ef71b9a..5f89641 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
*/
static const char rcsid[] =
- "$Id: ping.c,v 1.21 1997/03/04 22:05:49 imp Exp $";
+ "$Id: ping.c,v 1.22 1997/07/09 19:40:43 julian Exp $";
#endif /* not lint */
/*
@@ -544,7 +544,7 @@ pinger(void)
icp->icmp_type = ICMP_ECHO;
icp->icmp_code = 0;
icp->icmp_cksum = 0;
- icp->icmp_seq = ntransmitted++;
+ icp->icmp_seq = ntransmitted;
icp->icmp_id = ident; /* ID */
CLR(icp->icmp_seq % mx_dup_ck);
@@ -572,6 +572,8 @@ pinger(void)
warn("%s: partial write: %d of %d bytes",
hostname, cc, i);
}
+ } else {
+ ntransmitted++; /* only count those that made it out */
}
if (!(options & F_QUIET) && options & F_FLOOD)
(void)write(STDOUT_FILENO, &DOT, 1);
OpenPOWER on IntegriCloud