From: Serhii. Vlasiuk -X (svlasiuk - SOFTSERVE INC at Cisco) Date: Thu, 8 Feb 2024 17:40:11 +0000 (+0000) Subject: Pull request #4197: appid: check tenant_match() if required X-Git-Tag: 3.1.81.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0cbbb934788ccf9c9452b1683c1688becdd8d99;p=thirdparty%2Fsnort3.git Pull request #4197: appid: check tenant_match() if required Merge in SNORT/snort3 from ~SVLASIUK/snort3:appid_tenants_filter_perf_fix to master Squashed commit of the following: commit 942b0edd2df839e4fd3da0be3cc7f69610dce263 Author: Serhii Vlasiuk Date: Thu Feb 1 16:18:05 2024 +0200 appid: check tenant_match() if required --- diff --git a/src/network_inspectors/appid/appid_debug.cc b/src/network_inspectors/appid/appid_debug.cc index 9a3689b35..8f8c6b58b 100644 --- a/src/network_inspectors/appid/appid_debug.cc +++ b/src/network_inspectors/appid/appid_debug.cc @@ -102,11 +102,13 @@ void AppIdDebug::activate(const uint32_t* ip1, const uint32_t* ip2, uint16_t por const AppIdSession* session, bool log_all_sessions, uint32_t tenant_id, int16_t group1, int16_t group2, bool inter_group_flow) { - if (!( log_all_sessions or - ( info.proto_match(protocol) and + bool match = info.proto_match(protocol) and ( (info.port_match(port1, port2) and info.ip_match(ip1, ip2)) or - (info.port_match(port2, port1) and info.ip_match(ip2, ip1)) ) and - info.tenant_match(tenant_id) ) )) + (info.port_match(port2, port1) and info.ip_match(ip2, ip1)) ); + if (match) + match = info.tenant_match(tenant_id); + + if (!(log_all_sessions or match)) { active = false; return;