Fix hosts count when reverse_lookup_only preferences is enabled. #715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Fix hosts count when reverse_lookup_only preferences is enabled.
Why:
When this option is enabled, hosts without a hostname are removed from the host list, which changes the host count.
As this differs from the host expected by ospd-openvas, finishes the scan as INTERRUPTED.
How:
Run a scan (I tested via gvm-tools) with reverse_lookup_only enabled. Also, I added an excluded host, as this part of the code was modified as well. Ensure that some hosts in the target list can be reversed-lookup'ed.
gvm-cli --protocol OSP --timeout 120 socket --socketpath=/home/jnicola/install/var/run/ospd/openvas.sock --xml "<start_scan scan_id='829097a9-85d5-4bb8-bac0-e64c362b2836'>192.168.0.0/24<exclude_hosts>192.168.0.10</exclude_hosts><finished_hosts/>22testtest<reverse_lookup_only>1</reverse_lookup_only><scanner_params></scanner_params><vt_selection><vt_single id='1.3.6.1.4.1.25623.1.0.14259'/></vt_selection></start_scan>" |xmlstarlet fo
Checklist: