From: Philippe Antoine Date: Thu, 2 Dec 2021 09:29:40 +0000 (+0100) Subject: mqtt: fix transaction completion X-Git-Tag: suricata-6.0.5~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d7630d1424302465de9e7cba6e9abb8bc98f9bd;p=thirdparty%2Fsuricata.git mqtt: fix transaction completion 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) --- diff --git a/rust/src/mqtt/mqtt.rs b/rust/src/mqtt/mqtt.rs index 1c0894ada7..65e0e87359 100644 --- a/rust/src/mqtt/mqtt.rs +++ b/rust/src/mqtt/mqtt.rs @@ -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; }