From: Jason Ish Date: Mon, 18 Dec 2017 12:58:18 +0000 (-0600) Subject: dns-log: don't register if HAVE_RUST X-Git-Tag: suricata-4.1.0-beta1~449 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3103%2Fhead;p=thirdparty%2Fsuricata.git dns-log: don't register if HAVE_RUST 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 --- diff --git a/src/log-dnslog.c b/src/log-dnslog.c index 7b1ce7bc44..4da35ff75c 100644 --- a/src/log-dnslog.c +++ b/src/log-dnslog.c @@ -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 */ } diff --git a/src/runmodes.c b/src/runmodes.c index 0f6fea80c9..139a5a35d2 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -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;