]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dnp3: probing parser fixes direction based on dnp3 header
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 19 Jun 2020 09:53:16 +0000 (11:53 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 13 Jul 2020 13:39:04 +0000 (15:39 +0200)
(cherry picked from commit 629a16e3733dd577822d0c82d2e81cbeb3b9a4d2)

src/app-layer-dnp3.c

index cd50972fec05c2f038b75732237f264c47df65ac..2e764cc46c57795533854cec08620a8efa4905b2 100644 (file)
@@ -295,6 +295,11 @@ static uint16_t DNP3ProbingParser(Flow *f, uint8_t direction,
     }
 
 end:
+    // Test compatibility between direction and dnp3.ctl.direction
+    if ((DNP3_LINK_DIR(hdr->control) != 0) ^
+        ((direction & STREAM_TOCLIENT) != 0)) {
+        *rdir = 1;
+    }
     SCLogDebug("Detected DNP3.");
     return ALPROTO_DNP3;
 }