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
pull/3103/head
Jason Ish 8 years ago committed by Victor Julien
parent 5a8537fe4a
commit cf8d770caa

@ -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 */
}

@ -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;

Loading…
Cancel
Save