From 9d07cf28114eaa6232e93248b2346710ae635bf3 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:46:55 +0200 Subject: fuzz: try to be a little bit faster (#2559) Some fuzzers don't really need a real and complete local context. Try to avoid setting it up, creating a simpler fake version with only the features really needed. That is a kind of experiment: if it works, we can extend the same logic to other fuzzers --- example/reader_util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'example/reader_util.c') diff --git a/example/reader_util.c b/example/reader_util.c index 71f5ed39d..d38850fc4 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -372,6 +372,9 @@ int parse_proto_name_list(char *str, NDPI_PROTOCOL_BITMASK *bitmask, int inverte return 1; NDPI_BITMASK_SET_ALL(all); ndpi_set_protocol_detection_bitmask2(module, &all); + /* Try to be fast: we need only the protocol name -> protocol id mapping! */ + ndpi_set_config(module, "any", "ip_list.load", "0"); + ndpi_set_config(module, NULL, "flow_risk_lists.load", "0"); ndpi_finalize_initialization(module); for(n = strtok(str,_proto_delim); n && *n; n = strtok(NULL,_proto_delim)) { -- cgit v1.2.3