]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mqtt: fix transaction completion 6700/head
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 2 Dec 2021 09:29:40 +0000 (10:29 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Fri, 10 Dec 2021 14:38:36 +0000 (20:08 +0530)
Ticket: 4862

A transaction to client is always considered
complete in the direction to server and vice versa.
Otherwise, transactions are never complete for
AppLayerParserTransactionsCleanup

(cherry picked from commit 1b10848d84f6417a4030e5814db246b369b77593)

rust/src/mqtt/mqtt.rs

index 1c0894ada79f222a1a44c345668196ef1ca44cd0..65e0e87359ed66183e1755a92c1508a29c928aac 100644 (file)
@@ -664,19 +664,11 @@ pub extern "C" fn rs_mqtt_tx_is_toclient(tx: *const std::os::raw::c_void) -> std
 #[no_mangle]
 pub extern "C" fn rs_mqtt_tx_get_alstate_progress(
     tx: *mut std::os::raw::c_void,
-    direction: u8,
+    _direction: u8,
 ) -> std::os::raw::c_int {
     let tx = cast_pointer!(tx, MQTTTransaction);
     if tx.complete {
-        if direction == core::STREAM_TOSERVER {
-            if tx.toserver {
-                return 1;
-            }
-        } else if direction == core::STREAM_TOCLIENT {
-            if tx.toclient {
-                return 1;
-            }
-        }
+        return 1;
     }
     return 0;
 }