From: Victor Julien Date: Tue, 4 Feb 2014 13:07:10 +0000 (+0100) Subject: json dns: fix tx logic X-Git-Tag: suricata-2.0rc1~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ce1fd347e251a3c1e2ac05ade951838fabae287;p=thirdparty%2Fsuricata.git json dns: fix tx logic The JSON DNS logger would still have some conditions in the main Logger function. This led to some transactions not beeing logged. --- diff --git a/src/output-json-dns.c b/src/output-json-dns.c index 00ac24eeed..d951219fa9 100644 --- a/src/output-json-dns.c +++ b/src/output-json-dns.c @@ -222,22 +222,13 @@ static int JsonDnsLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flo if (unlikely(js == NULL)) return TM_ECODE_OK; -#if QUERY - if (PKT_IS_TOSERVER(p)) { - DNSQueryEntry *entry = NULL; - TAILQ_FOREACH(entry, &tx->query_list, next) { - LogQuery(aft, timebuf, srcip, dstip, sp, dp, tx, proto_s, entry); - } - } else -#endif - if ((PKT_IS_TOCLIENT(p))) { - DNSQueryEntry *query = NULL; - TAILQ_FOREACH(query, &tx->query_list, next) { - LogQuery(td, js, tx, query); - } - - LogAnswers(td, js, tx); + DNSQueryEntry *query = NULL; + TAILQ_FOREACH(query, &tx->query_list, next) { + LogQuery(td, js, tx, query); } + + LogAnswers(td, js, tx); + json_decref(js); SCReturnInt(TM_ECODE_OK);