]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns-log: don't register if HAVE_RUST
authorJason Ish <ish@unx.ca>
Mon, 18 Dec 2017 12:58:18 +0000 (06:58 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Jan 2018 09:32:16 +0000 (10:32 +0100)
Log just one notice message when attempting to register
this logger with HAVE_RUST, instead of logging on
every attempt to output a DNS record.

Issue:
https://redmine.openinfosecfoundation.org/issues/2365

src/log-dnslog.c
src/runmodes.c

index 7b1ce7bc44b4c4922a3ad2e61382bc1ae2701fb2..4da35ff75cdcb50cdec06f005397e5aad9f4577f 100644 (file)
@@ -49,6 +49,8 @@
 #include "util-logopenfile.h"
 #include "util-time.h"
 
+#ifndef HAVE_RUST
+
 #define DEFAULT_LOG_FILENAME "dns.log"
 
 #define MODULE_NAME "LogDnsLog"
@@ -164,10 +166,6 @@ static void LogAnswer(LogDnsLogThread *aft, char *timebuf, char *srcip, char *ds
 static int LogDnsLogger(ThreadVars *tv, void *data, const Packet *p,
     Flow *f, void *state, void *tx, uint64_t tx_id, uint8_t direction)
 {
-#ifdef HAVE_RUST
-    SCLogNotice("LogDnsLogger not implemented for Rust DNS.");
-    return 0;
-#endif
     LogDnsLogThread *aft = (LogDnsLogThread *)data;
     DNSTransaction *dns_tx = (DNSTransaction *)tx;
     SCLogDebug("pcap_cnt %"PRIu64, p->pcap_cnt);
@@ -358,8 +356,11 @@ static OutputCtx *LogDnsLogInitCtx(ConfNode *conf)
     return output_ctx;
 }
 
+#endif /* !HAVE_RUST */
+
 void LogDnsLogRegister (void)
 {
+#ifndef HAVE_RUST
     /* Request logger. */
     OutputRegisterTxModuleWithProgress(LOGGER_DNS, MODULE_NAME, "dns-log",
         LogDnsLogInitCtx, ALPROTO_DNS, LogDnsRequestLogger, 0, 1,
@@ -372,4 +373,5 @@ void LogDnsLogRegister (void)
 
     /* enable the logger for the app layer */
     SCLogDebug("registered %s", MODULE_NAME);
+#endif /* !HAVE_RUST */
 }
index 0f6fea80c9351df13097c96a2b21f79bad6df293..139a5a35d22495c90373d498da73653c7172c389 100644 (file)
@@ -748,6 +748,12 @@ void RunModeInitializeOutputs(void)
                     "recompile with lua(jit) and its development "
                     "files installed to add lua support.");
             continue;
+#endif
+        } else if (strcmp(output->val, "dns-log") == 0) {
+#ifdef HAVE_RUST
+            SCLogWarning(SC_ERR_NOT_SUPPORTED,
+                    "dns-log is not available when Rust is enabled.");
+            continue;
 #endif
         } else if (strcmp(output->val, "tls-log") == 0) {
             tls_log_enabled = 1;