mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 23:02:02 -04:00
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:
parent
296596145c
commit
32af342f58
1 changed files with 9 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue