suricata: add --disable-hashing option

The idea with a flag to disable hashing is to provide a way to
get the effect of building Suricata without libnss, which is
sometimes done for performance reasons.
pull/5722/head
Jason Ish 4 years ago committed by Victor Julien
parent 245a1bd4ce
commit f723dc1309

@ -233,6 +233,10 @@ int g_disable_randomness = 1;
* comparing flows */
uint16_t g_vlan_mask = 0xffff;
/* flag to disable hashing almost globally, to be similar to disabling nss
* support */
bool g_disable_hashing = false;
/** Suricata instance */
SCInstance suricata;
@ -1225,6 +1229,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
{"pidfile", required_argument, 0, 0},
{"init-errors-fatal", 0, 0, 0},
{"disable-detection", 0, 0, 0},
{"disable-hashing", 0, 0, 0},
{"fatal-unittests", 0, 0, 0},
{"unittests-coverage", 0, &coverage_unittests, 1},
{"user", required_argument, 0, 0},
@ -1427,8 +1432,9 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
}
else if(strcmp((long_opts[option_index]).name, "disable-detection") == 0) {
g_detect_disabled = suri->disabled_detect = 1;
}
else if(strcmp((long_opts[option_index]).name, "fatal-unittests") == 0) {
} else if (strcmp((long_opts[option_index]).name, "disable-hashing") == 0) {
g_disable_hashing = true;
} else if (strcmp((long_opts[option_index]).name, "fatal-unittests") == 0) {
#ifdef UNITTESTS
unittests_fatal = 1;
#else

@ -171,6 +171,9 @@ extern volatile uint8_t suricata_ctl_flags;
extern int g_disable_randomness;
extern uint16_t g_vlan_mask;
/* Flag to disable hashing (almost) globally. */
extern bool g_disable_hashing;
#include <ctype.h>
#define u8_tolower(c) tolower((uint8_t)(c))
#define u8_toupper(c) toupper((uint8_t)(c))

Loading…
Cancel
Save