From: Torgeir Natvig Date: Fri, 16 Oct 2015 22:44:49 +0000 (+0200) Subject: Bugfix for detect-engine.luajit-states X-Git-Tag: suricata-3.0RC1~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af6d1dddfa0da9b0f6db8655e3c3dc0b66f01d31;p=thirdparty%2Fsuricata.git Bugfix for detect-engine.luajit-states detect-engine is a list, and luajit-states was looked up as a map. --- diff --git a/src/detect-lua.c b/src/detect-lua.c index d5da19d81e..a3eead4a9e 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -192,12 +192,18 @@ int DetectLuajitSetupStatesPool(int num, int reloads) pthread_mutex_lock(&luajit_states_lock); if (luajit_states == NULL) { - int cnt = 0; - char *conf_val = NULL; + intmax_t cnt = 0; + ConfNode *denode = NULL; + ConfNode *decnf = ConfGetNode("detect-engine"); + if (decnf != NULL) { + TAILQ_FOREACH(denode, &decnf->head, next) { + if (strcmp(denode->val, "luajit-states") == 0) { + ConfGetChildValueInt(denode, "luajit-states", &cnt); + } + } + } - if ((ConfGet("detect-engine.luajit-states", &conf_val)) == 1) { - cnt = (int)atoi(conf_val); - } else { + if (cnt == 0) { int cpus = UtilCpuGetNumProcessorsOnline(); if (cpus == 0) { cpus = 10;