]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4197: appid: check tenant_match() if required
authorSerhii. Vlasiuk -X (svlasiuk - SOFTSERVE INC at Cisco) <svlasiuk@cisco.com>
Thu, 8 Feb 2024 17:40:11 +0000 (17:40 +0000)
committerSteve Chew (stechew) <stechew@cisco.com>
Thu, 8 Feb 2024 17:40:11 +0000 (17:40 +0000)
Merge in SNORT/snort3 from ~SVLASIUK/snort3:appid_tenants_filter_perf_fix to master

Squashed commit of the following:

commit 942b0edd2df839e4fd3da0be3cc7f69610dce263
Author: Serhii Vlasiuk <svlasiuk@cisco.com>
Date:   Thu Feb 1 16:18:05 2024 +0200

    appid: check tenant_match() if required

src/network_inspectors/appid/appid_debug.cc

index 9a3689b35df7f02c0f59e38745afa81763ce5c77..8f8c6b58b6a5b56c28b7b134b1d4246ae3736089 100644 (file)
@@ -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;