Skip to content

Commit

Permalink
Do not unnecessarily wait for replies
Browse files Browse the repository at this point in the history
If already all hosts in the target list were
identified as alive we do not need to wait for
ping replies anymore.
  • Loading branch information
ArnoStiefvater committed Sep 3, 2020
1 parent bd3c5d2 commit 608a4f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion boreas/alivedetection.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ scan (alive_test_t alive_test)
g_debug (
"%s: all ping packets have been sent, wait a bit for rest of replies.",
__func__);
sleep (WAIT_FOR_REPLIES_TIMEOUT);

/* If all targets are already indentified as alive we do not need to wait for
* replies anymore.*/
if (number_of_targets
!= (int) g_hash_table_size (scanner.hosts_data->alivehosts))
sleep (WAIT_FOR_REPLIES_TIMEOUT);

stop_sniffer_thread (&scanner, sniffer_thread_id);

Expand Down

0 comments on commit 608a4f4

Please sign in to comment.