]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1485 in SNORT/snort3 from ~SMINUT/snort3:rate_filter to master
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 15 Jan 2019 15:04:04 +0000 (10:04 -0500)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 15 Jan 2019 15:04:04 +0000 (10:04 -0500)
Squashed commit of the following:

commit 53bd9d1b460654243172c7e253eec8ca422f262a
Author: Silviu Minut <sminut@cisco.com>
Date:   Thu Jan 10 17:17:14 2019 -0500

    filters: call get_ips_policy instead of get_network_policy when building the key for rate filter.

src/filters/sfrf.cc

index f147092c2be456ec031eca1b0501c1a21850cb24..991dbb778492fd9013e48bc9c9c794679c005ae2 100644 (file)
@@ -222,7 +222,7 @@ int SFRF_ConfigAdd(snort::SnortConfig*, RateFilterConfig* rf_config, tSFRFConfig
     tSFRFConfigNode* pNewConfigNode;
     tSFRFGenHashKey key = { 0,0 };
 
-    PolicyId policy_id = snort::get_network_policy()->policy_id;
+    PolicyId policy_id = snort::get_ips_policy()->policy_id;
 
     // Auto init - memcap must be set 1st, which is not really a problem
     if ( rf_hash == nullptr )
@@ -456,7 +456,7 @@ int SFRF_TestThreshold(
     int status = -1;
     tSFRFGenHashKey key;
 
-    PolicyId policy_id = snort::get_network_policy()->policy_id;
+    PolicyId policy_id = snort::get_ips_policy()->policy_id;
 
 #ifdef SFRF_DEBUG
     printf("--%d-%u-%u: %s() entering\n", 0, gid, sid, __func__);
@@ -781,7 +781,7 @@ static tSFRFTrackingNode* _getSFRFTrackingNode(const snort::SfIp* ip, unsigned t
     /* Setup key */
     key.ip = *(ip);
     key.tid = tid;
-    key.policyId = snort::get_network_policy()->policy_id;
+    key.policyId = snort::get_ips_policy()->policy_id;
     key.padding = 0;
 
     /*
@@ -804,4 +804,3 @@ static tSFRFTrackingNode* _getSFRFTrackingNode(const snort::SfIp* ip, unsigned t
     }
     return dynNode;
 }
-