]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
geoip: fix unittests w/o db present
authorVictor Julien <victor@inliniac.net>
Fri, 21 Jun 2019 19:40:20 +0000 (21:40 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 1 Jul 2019 13:44:30 +0000 (15:44 +0200)
src/detect-geoip.c

index 0558b2a5f1956de05293c3b8a2f13298d8eeca27..d1710b21189e17fe7c7f6e81c2b4539442a5bb4b 100644 (file)
@@ -373,9 +373,12 @@ static DetectGeoipData *DetectGeoipDataParse (const char *str)
         SCLogDebug("negated geoip");
     }
 
-    /* Initialize the geolocation engine */
-    if (InitGeolocationEngine(geoipdata) == false)
-        goto error;
+    /* init geo engine, but not when running as unittests */
+    if (!(RunmodeIsUnittests())) {
+        /* Initialize the geolocation engine */
+        if (InitGeolocationEngine(geoipdata) == false)
+            goto error;
+    }
 
     return geoipdata;