Fixed two bugs with the "-l preload" option:

- first ping after a preload was sent undelayed
- we could send more than -c packets in preload

PR:		bin/32354
This commit is contained in:
Ruslan Ermilov 2002-01-14 14:33:35 +00:00
parent 296596145c
commit 32af342f58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89349

View File

@ -620,8 +620,15 @@ main(argc, argv)
tcsetattr(STDOUT_FILENO, TCSANOW, &ts);
}
while (preload--) /* fire off them quickies */
pinger();
if (preload == 0)
pinger(); /* send the first ping */
else {
if (npackets != 0 && preload > npackets)
preload = npackets;
while (preload--) /* fire off them quickies */
pinger();
}
(void)gettimeofday(&last, NULL);
if (options & F_FLOOD) {
intvl.tv_sec = 0;
@ -631,9 +638,6 @@ main(argc, argv)
intvl.tv_usec = interval % 1000 * 1000;
}
pinger(); /* send the first ping */
(void)gettimeofday(&last, NULL);
while (!finish_up) {
register int cc;
int n;