]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns: Logging of Z-bit
authorOdin Jenseg <odin@mnemonic.no>
Tue, 8 Jun 2021 19:55:36 +0000 (21:55 +0200)
committerJason Ish <jason.ish@oisf.net>
Tue, 21 Dec 2021 22:50:06 +0000 (16:50 -0600)
[Edit by Jason Ish: fix flag bit value]

Ticket #4515

rust/src/dns/log.rs

index 5c379ff1405b495c5047822c0f323a431137c8d5..a63a784e0760a956c5184cf57189a7c66d562bac 100644 (file)
@@ -503,6 +503,9 @@ fn dns_log_json_answer(js: &mut JsonBuilder, response: &DNSResponse, flags: u64)
     if header.flags & 0x0080 != 0 {
         js.set_bool("ra", true)?;
     }
+    if header.flags & 0x0040 != 0 {
+        js.set_bool("z", true)?;
+    }
 
     for query in &response.queries {
         js.set_string_from_bytes("rrname", &query.name)?;
@@ -705,6 +708,9 @@ fn dns_log_json_answer_v1(header: &DNSHeader, answer: &DNSAnswerEntry)
     if header.flags & 0x0080 != 0 {
         js.set_bool("ra", true)?;
     }
+    if header.flags & 0x0040 != 0 {
+        js.set_bool("z", true)?;
+    }
     js.set_string("rcode", &dns_rcode_string(header.flags))?;
     js.set_string_from_bytes("rrname", &answer.name)?;
     js.set_string("rrtype", &dns_rrtype_string(answer.rrtype))?;