From ce4ac606d4e9cbdb4de06f1c9fb261b59bd2fef2 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 22 Mar 2021 16:02:19 +0100 Subject: [PATCH] Compilation fix --- src/Geolocation.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Geolocation.cpp b/src/Geolocation.cpp index aae81142ba..ce43bb0973 100644 --- a/src/Geolocation.cpp +++ b/src/Geolocation.cpp @@ -31,8 +31,6 @@ /* *************************************** */ Geolocation::Geolocation() { - mmdbs_ok = false; - #ifdef HAVE_MAXMINDDB char docs_path[MAX_PATH]; const char *lookup_paths[] = { @@ -48,6 +46,8 @@ Geolocation::Geolocation() { docs_path }; + mmdbs_ok = false; + snprintf(docs_path, sizeof(docs_path), "%s/geoip", ntop->getPrefs()->get_docs_dir()); ntop->fixPath(docs_path); @@ -107,7 +107,10 @@ Geolocation::Geolocation() { #endif #ifndef WIN32 - if(!mmdbs_ok) { +#ifdef HAVE_MAXMINDDB + if(!mmdbs_ok) +#endif + { ntop->getTrace()->traceEvent(TRACE_NORMAL, "Running without geolocation support."); ntop->getTrace()->traceEvent(TRACE_NORMAL, "To enable geolocation follow the instructions at"); ntop->getTrace()->traceEvent(TRACE_NORMAL, "https://github.com/ntop/ntopng/blob/dev/doc/README.geolocation.md");