don't count packets as being transmitted when we know that the sendto()
failed (e.g. ENOBUFS)
This commit is contained in:
parent
515dd2fa3f
commit
0e59c641dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27301
@ -45,7 +45,7 @@ static const char copyright[] =
|
|||||||
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
|
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
|
||||||
*/
|
*/
|
||||||
static const char rcsid[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -544,7 +544,7 @@ pinger(void)
|
|||||||
icp->icmp_type = ICMP_ECHO;
|
icp->icmp_type = ICMP_ECHO;
|
||||||
icp->icmp_code = 0;
|
icp->icmp_code = 0;
|
||||||
icp->icmp_cksum = 0;
|
icp->icmp_cksum = 0;
|
||||||
icp->icmp_seq = ntransmitted++;
|
icp->icmp_seq = ntransmitted;
|
||||||
icp->icmp_id = ident; /* ID */
|
icp->icmp_id = ident; /* ID */
|
||||||
|
|
||||||
CLR(icp->icmp_seq % mx_dup_ck);
|
CLR(icp->icmp_seq % mx_dup_ck);
|
||||||
@ -572,6 +572,8 @@ pinger(void)
|
|||||||
warn("%s: partial write: %d of %d bytes",
|
warn("%s: partial write: %d of %d bytes",
|
||||||
hostname, cc, i);
|
hostname, cc, i);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ntransmitted++; /* only count those that made it out */
|
||||||
}
|
}
|
||||||
if (!(options & F_QUIET) && options & F_FLOOD)
|
if (!(options & F_QUIET) && options & F_FLOOD)
|
||||||
(void)write(STDOUT_FILENO, &DOT, 1);
|
(void)write(STDOUT_FILENO, &DOT, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user