From: Victor Julien Date: Tue, 8 Dec 2015 18:55:40 +0000 (+0100) Subject: afl: optionally exit right after afl single runmode X-Git-Tag: suricata-3.1RC1~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09242fb4a8a04c2ed9486cf973862d6a89269397;p=thirdparty%2Fsuricata.git afl: optionally exit right after afl single runmode Exit right away if afl.exit_after_pcap is set to true. Safes time as fuzzing the shutdown code may not be as interesting. --- diff --git a/src/runmode-pcap-file.c b/src/runmode-pcap-file.c index 4d44814be7..eede9f4d11 100644 --- a/src/runmode-pcap-file.c +++ b/src/runmode-pcap-file.c @@ -125,6 +125,12 @@ int RunModeFilePcapSingle(void) /* in afl mode we don't spawn a new thread, but run the pipeline * in the main thread */ tv->tm_func(tv); + int afl_runmode_exit_immediately = 0; + (void)ConfGetBool("afl.exit_after_pcap", &afl_runmode_exit_immediately); + if (afl_runmode_exit_immediately) { + SCLogNotice("exit because of afl-runmode-exit-after-pcap commandline option"); + exit(EXIT_SUCCESS); + } #endif return 0;