]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
json dns: fix tx logic
authorVictor Julien <victor@inliniac.net>
Tue, 4 Feb 2014 13:07:10 +0000 (14:07 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 4 Feb 2014 13:07:10 +0000 (14:07 +0100)
The JSON DNS logger would still have some conditions in the main
Logger function. This led to some transactions not beeing logged.

src/output-json-dns.c

index 00ac24eeed8846e515f406b60a7370cf81d9da2a..d951219fa9265d5ef8b2d1ab056f862c5d957938 100644 (file)
@@ -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);