stop sending echo packets whenever the upper limit is specified by the -c
option, regardless of the -f option. based on a comment from Tomohide Nagashima <tomohide@japan-telecom.co.jp>. Obtained from: KAME MFC after: 1 week
This commit is contained in:
parent
7aa7260e4a
commit
5310af8b90
@ -262,7 +262,7 @@ void onsignal __P((int));
|
||||
void retransmit __P((void));
|
||||
void onint __P((int));
|
||||
size_t pingerlen __P((void));
|
||||
void pinger __P((void));
|
||||
int pinger __P((void));
|
||||
const char *pr_addr __P((struct sockaddr *, int));
|
||||
void pr_icmph __P((struct icmp6_hdr *, u_char *));
|
||||
void pr_iph __P((struct ip6_hdr *));
|
||||
@ -979,7 +979,7 @@ main(argc, argv)
|
||||
printf("%s\n", pr_addr((struct sockaddr *)&dst, sizeof(dst)));
|
||||
|
||||
while (preload--) /* Fire off them quickies. */
|
||||
pinger();
|
||||
(void)pinger();
|
||||
|
||||
(void)signal(SIGINT, onsignal);
|
||||
#ifdef SIGINFO
|
||||
@ -1029,7 +1029,7 @@ main(argc, argv)
|
||||
#endif
|
||||
|
||||
if (options & F_FLOOD) {
|
||||
pinger();
|
||||
(void)pinger();
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
tv = &timeout;
|
||||
@ -1124,10 +1124,8 @@ retransmit()
|
||||
{
|
||||
struct itimerval itimer;
|
||||
|
||||
if (!npackets || ntransmitted < npackets) {
|
||||
pinger();
|
||||
if (pinger() == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're not transmitting any more packets, change the timer
|
||||
@ -1176,7 +1174,7 @@ pingerlen()
|
||||
return l;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
pinger()
|
||||
{
|
||||
struct icmp6_hdr *icp;
|
||||
@ -1185,6 +1183,9 @@ pinger()
|
||||
struct icmp6_nodeinfo *nip;
|
||||
int seq;
|
||||
|
||||
if (npackets && ntransmitted >= npackets)
|
||||
return(-1); /* no more transmission */
|
||||
|
||||
icp = (struct icmp6_hdr *)outpack;
|
||||
nip = (struct icmp6_nodeinfo *)outpack;
|
||||
memset(icp, 0, sizeof(*icp));
|
||||
@ -1279,6 +1280,8 @@ pinger()
|
||||
}
|
||||
if (!(options & F_QUIET) && options & F_FLOOD)
|
||||
(void)write(STDOUT_FILENO, &DOT, 1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
x
Reference in New Issue
Block a user