]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/dns/tcp - probe even if payload is short 2838/head
authorJason Ish <ish@unx.ca>
Thu, 13 Jul 2017 16:28:48 +0000 (10:28 -0600)
committerVictor Julien <victor@inliniac.net>
Fri, 14 Jul 2017 09:57:34 +0000 (11:57 +0200)
As the DNS probe just uses the query portion of a response, don't
require there to be as many bytes as specified in the TCP DNS
header. This can occur in large responses where probe is called
without all the data.

Fixes the cases where the app proto is recorded as failed.

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2169

rust/src/dns/dns.rs

index 9c69642451b8e7362b01c4d6affbbd1b2aa007df..b599eda54f339e59b6695767c058c3d7503c4653 100644 (file)
@@ -545,10 +545,8 @@ fn probe(input: &[u8]) -> bool {
 /// Probe TCP input to see if it looks like DNS.
 pub fn probe_tcp(input: &[u8]) -> bool {
     match nom::be_u16(input) {
-        nom::IResult::Done(rem, len) => {
-            if rem.len() >= len as usize {
-                return probe(rem);
-            }
+        nom::IResult::Done(rem, _) => {
+            return probe(rem);
         },
         _ => {}
     }