Skip to content

Commit

Permalink
Send duplicated hosts as dead hosts to ospd, to adjust scan progress …
Browse files Browse the repository at this point in the history
…calculation.

Duplicated hosts are removed from the list and ospd-openvas
needs to know that less hosts will be scanned, for the scan progress
calculation. Sent the amount of duplicated hosts as dead hosts to not
be taken in account.
  • Loading branch information
jjnicola committed Aug 21, 2020
1 parent 57ace3b commit d65e9af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fork vhosts before creating the socket.[#576](https://github.com/greenbone/openvas/pull/576)
- Check if another forked child has already added the same vhost. [#581](https://github.com/greenbone/openvas/pull/581)
- Send duplicated hosts as dead hosts to ospd, to adjust scan progress calculation. [#586](https://github.com/greenbone/openvas/pull/586)

[20.08]: https://github.com/greenbone/openvas/compare/v20.8.0...openvas-20.08

Expand Down
8 changes: 8 additions & 0 deletions src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,14 @@ attack_network (struct scan_globals *globals)

hosts = gvm_hosts_new (hostlist);
unresolved = gvm_hosts_resolve (hosts);

/* Duplicated hosts are removed from the list and ospd-openvas
needs to know that less hosts will be scanned, for the scan progress
calculation. Sent the amount of duplicated hosts as dead hosts to not
be taken in account. */
if (gvm_hosts_duplicated (hosts))
send_dead_hosts_to_ospd_openvas (gvm_hosts_duplicated (hosts));

while (unresolved)
{
g_warning ("Couldn't resolve hostname '%s'", (char *) unresolved->data);
Expand Down

0 comments on commit d65e9af

Please sign in to comment.