about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-06-05 09:20:30 +0200
committervanhauser-thc <vh@thc.org>2024-06-05 09:20:30 +0200
commit2806d6be2f1d26eed7b42ae580f5bf7a29713a01 (patch)
treef6c4f3c8736f775c9245940e262f15ffb43afc9e
parent2d9b793dbbe9288a1caa4459c280678179bb46c9 (diff)
downloadafl++-2806d6be2f1d26eed7b42ae580f5bf7a29713a01.tar.gz
optimize syncing
-rw-r--r--include/config.h4
-rw-r--r--src/afl-fuzz.c25
2 files changed, 10 insertions, 19 deletions
diff --git a/include/config.h b/include/config.h
index 3727dab1..ebe40022 100644
--- a/include/config.h
+++ b/include/config.h
@@ -324,9 +324,9 @@
 #define SYNC_INTERVAL 8
 
 /* Sync time (minimum time between syncing in ms, time is halfed for -M main
-   nodes) - default is 30 minutes: */
+   nodes) - default is 20 minutes: */
 
-#define SYNC_TIME (30 * 60 * 1000)
+#define SYNC_TIME (20 * 60 * 1000)
 
 /* Output directory reuse grace period (minutes): */
 
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 0f6216c4..49d25d5a 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -2943,35 +2943,26 @@ int main(int argc, char **argv_orig, char **envp) {
 
     if (likely(!afl->stop_soon && afl->sync_id)) {
 
-      if (likely(afl->skip_deterministic)) {
+      if (unlikely(afl->is_main_node)) {
 
-        if (unlikely(afl->is_main_node)) {
+        if (unlikely(cur_time > (afl->sync_time >> 1) + afl->last_sync_time)) {
 
-          if (unlikely(cur_time >
-                       (afl->sync_time >> 1) + afl->last_sync_time)) {
+          if (!(sync_interval_cnt++ % (SYNC_INTERVAL / 3))) {
 
-            if (!(sync_interval_cnt++ % (SYNC_INTERVAL / 3))) {
-
-              sync_fuzzers(afl);
-
-            }
+            sync_fuzzers(afl);
 
           }
 
-        } else {
+        }
 
-          if (unlikely(cur_time > afl->sync_time + afl->last_sync_time)) {
+      } else {
 
-            if (!(sync_interval_cnt++ % SYNC_INTERVAL)) { sync_fuzzers(afl); }
+        if (unlikely(cur_time > afl->sync_time + afl->last_sync_time)) {
 
-          }
+          if (!(sync_interval_cnt++ % SYNC_INTERVAL)) { sync_fuzzers(afl); }
 
         }
 
-      } else {
-
-        sync_fuzzers(afl);
-
       }
 
     }