about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEdznux <edznux@gmail.com>2020-10-03 23:56:55 +0200
committerEdznux <edznux@gmail.com>2020-10-03 23:56:55 +0200
commit26dcddab0cdb3ca662746b1fd02cd58de3266269 (patch)
treecdced0e1684c0f3400a828adee30710c7b89a945
parent223974336196a8f3617548e8ca88ee084794ed60 (diff)
downloadafl++-26dcddab0cdb3ca662746b1fd02cd58de3266269.tar.gz
Add config ifdef
-rw-r--r--include/config.h6
-rw-r--r--src/afl-fuzz-run.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 77407d50..104276e3 100644
--- a/include/config.h
+++ b/include/config.h
@@ -41,6 +41,12 @@
 
 #define USE_COLOR
 
+/* Enable sending statistics over a StatsD daemon.
+Server config can be adjusted with AFL_STATSD_HOST and AFL_STATSD_PORT env var.
+*/
+
+#define USE_STATSD
+
 /* If you want to have the original afl internal memory corruption checks.
    Disabled by default for speed. it is better to use "make ASAN_BUILD=1". */
 
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 8dc0b334..b7c4ae05 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -901,10 +901,12 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
       afl->stage_cur + 1 == afl->stage_max) {
 
     show_stats(afl);
+    #ifdef USE_STATSD
     if(send_statsd_metric(afl)){
       //Change me to something realistic; don't fail on connection / lookup fail for metrics...
       exit(1);
     }
+    #endif
   }
 
   return 0;