From: Jason Ish Date: Thu, 22 Apr 2021 15:38:24 +0000 (-0600) Subject: tx: fix unidir tx cleanup X-Git-Tag: suricata-7.0.0-beta1~1661 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afaa18c5ad183d068795cf15d21d3642814ceb23;p=thirdparty%2Fsuricata.git tx: fix unidir tx cleanup A unidirection protocol parser should only have its transactions marked as "skipped" if it is skipped in both the TS and TC directions, otherwise unidir transactions are always considered skipped and the cleanup will never updates its minimum id. Redmine issue: https://redmine.openinfosecfoundation.org/issues/4437 --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 982e0978be..4814ee572b 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -951,7 +951,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) if (!(detect_flags_ts & APP_LAYER_TX_INSPECTED_FLAG)) { SCLogDebug("%p/%"PRIu64" skipping: TS inspect not done: ts:%"PRIx64, tx, i, detect_flags_ts); - tx_skipped = skipped = true; + tx_skipped = true; } else { inspected = true; } @@ -961,7 +961,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) if (!(detect_flags_tc & APP_LAYER_TX_INSPECTED_FLAG)) { SCLogDebug("%p/%"PRIu64" skipping: TC inspect not done: tc:%"PRIx64, tx, i, detect_flags_tc); - tx_skipped = skipped = true; + tx_skipped = true; } else { inspected = true; } @@ -972,6 +972,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) // been inspected. if (!is_unidir && tx_skipped) { SCLogDebug("%p/%" PRIu64 " !is_unidir && tx_skipped", tx, i); + skipped = true; goto next; } @@ -981,6 +982,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) // tx inspected flag checked. if (is_unidir && tx_skipped && !inspected) { SCLogDebug("%p/%" PRIu64 " is_unidir && tx_skipped && !inspected", tx, i); + skipped = true; goto next; }