From e48e8cfdddadc8f81070401000275fd77416de08 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Fri, 19 Jun 2020 14:01:07 +0200 Subject: [PATCH 1/3] Sleep between checks for last plugin to finish before changing to another category When a plugin is the last one for a plugin's category, it must finish before jumping to the next one. e.g from ACT_ATTACK to ACT_END This sleep prevents to get 100% processor usage during the wait of last plugin's execution. --- src/attack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/attack.c b/src/attack.c index 157c068ee..50beeecfc 100644 --- a/src/attack.c +++ b/src/attack.c @@ -506,6 +506,8 @@ attack_host (struct scan_globals *globals, struct in6_addr *ip, GSList *vhosts, } else if (plugin == NULL) break; + else if (plugin != NULL && plugin == PLUG_RUNNING) + usleep (50000); pluginlaunch_wait_for_free_process (kb); } From 57f6710116cd2a145661296cbb167c3969dab712 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Fri, 19 Jun 2020 14:04:58 +0200 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d88c184b6..5dec3128e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Memleak fixes for kb_item_get_str(). [#502](https://github.com/greenbone/openvas/pull/502) - Fix denied hosts. [#510](https://github.com/greenbone/openvas/pull/510) - Fix openvas-nasl. Add kb key/value for all vhosts. [#533](https://github.com/greenbone/openvas/pull/533) +- Wait for last plugin to finish before change to other category. [#534](https://github.com/greenbone/openvas/pull/534) ### Removed - Removed "network scan" mode. This includes removal of NASL API methods "scan_phase()" and "network_targets()". Sending a "network_mode=yes" in a scanner configuration will have no effect anymore. [#493](https://github.com/greenbone/openvas/pull/493) From 2653f81dc055e2058b8582681c4e48b9a4a0dcfd Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Mon, 22 Jun 2020 10:27:55 +0200 Subject: [PATCH 3/3] Make obvios the wait time in miliseconds with a comment --- src/attack.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/attack.c b/src/attack.c index 50beeecfc..93815186f 100644 --- a/src/attack.c +++ b/src/attack.c @@ -507,6 +507,7 @@ attack_host (struct scan_globals *globals, struct in6_addr *ip, GSList *vhosts, else if (plugin == NULL) break; else if (plugin != NULL && plugin == PLUG_RUNNING) + /* 50 miliseconds. */ usleep (50000); pluginlaunch_wait_for_free_process (kb); }