]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mqtt: add TX orientation
authorEric Leblond <el@stamus-networks.com>
Mon, 23 Jan 2023 19:04:00 +0000 (20:04 +0100)
committerVictor Julien <vjulien@oisf.net>
Sat, 1 Apr 2023 05:07:33 +0000 (07:07 +0200)
Set no inspection in the opposite side of the transaction.

Ticket: #5799

rust/src/mqtt/mqtt.rs

index 9517a672948c2906880ecdb8de1454cf29f5d095..7cd5394d49f784b647c80bcb6b1cc64799478567 100644 (file)
@@ -21,6 +21,8 @@ use super::mqtt_message::*;
 use super::parser::*;
 use crate::applayer::{self, LoggerFlags};
 use crate::applayer::*;
+use crate::core::STREAM_TOCLIENT;
+use crate::core::STREAM_TOSERVER;
 use crate::core::{self, AppProto, Flow, ALPROTO_FAILED, ALPROTO_UNKNOWN, IPPROTO_TCP};
 use num_traits::FromPrimitive;
 use crate::conf::conf_get;
@@ -183,8 +185,10 @@ impl MQTTState {
         tx.tx_id = self.tx_id;
         if toclient {
             tx.toclient = true;
+            tx.tx_data.set_inspect_direction(STREAM_TOCLIENT);
         } else {
             tx.toserver = true;
+            tx.tx_data.set_inspect_direction(STREAM_TOSERVER);
         }
         if self.transactions.len() > unsafe { MQTT_MAX_TX } {
             let mut index = self.tx_index_completed;