]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
thresholds: remove unneeded function argument
authorMats Klepsland <mats.klepsland@gmail.com>
Thu, 27 May 2021 08:59:36 +0000 (10:59 +0200)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 8 Jun 2021 11:09:45 +0000 (16:39 +0530)
Remove packet pointer from SigGetThresholdTypeIter() as it is
unused.

(cherry picked from commit b0b4fab7949dddeaf4c1b844c403dcc2c2470595)

src/detect-engine-alert.c
src/detect-engine-threshold.c
src/detect-engine-threshold.h

index f570fe94f90d2e9ebc07ed1df96c81b20c2df57d..90713facc56c4ac237d00d38e4f25e3a4c0412cd 100644 (file)
@@ -83,7 +83,7 @@ static int PacketAlertHandle(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det
         KEYWORD_PROFILING_SET_LIST(det_ctx, DETECT_SM_LIST_SUPPRESS);
         smd = NULL;
         do {
-            td = SigGetThresholdTypeIter(s, p, &smd, DETECT_SM_LIST_SUPPRESS);
+            td = SigGetThresholdTypeIter(s, &smd, DETECT_SM_LIST_SUPPRESS);
             if (td != NULL) {
                 SCLogDebug("td %p", td);
 
@@ -106,7 +106,7 @@ static int PacketAlertHandle(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det
         KEYWORD_PROFILING_SET_LIST(det_ctx, DETECT_SM_LIST_THRESHOLD);
         smd = NULL;
         do {
-            td = SigGetThresholdTypeIter(s, p, &smd, DETECT_SM_LIST_THRESHOLD);
+            td = SigGetThresholdTypeIter(s, &smd, DETECT_SM_LIST_THRESHOLD);
             if (td != NULL) {
                 SCLogDebug("td %p", td);
 
index eff4fe4f6b37f245be9f803761444a15985abc96..9c021a82563a1fcdf2ef71c8bac6b414282cb8a8 100644 (file)
@@ -104,16 +104,15 @@ int ThresholdIPPairHasThreshold(IPPair *pair)
 /**
  * \brief Return next DetectThresholdData for signature
  *
- * \param sig Signature pointer
- * \param p Packet structure
- * \param sm Pointer to a Signature Match pointer
+ * \param sig  Signature pointer
+ * \param psm  Pointer to a Signature Match pointer
+ * \param list List to return data from
  *
  * \retval tsh Return the threshold data from signature or NULL if not found
- *
- *
  */
 const DetectThresholdData *SigGetThresholdTypeIter(const Signature *sig,
-        Packet *p, const SigMatchData **psm, int list)
+                                                   const SigMatchData **psm,
+                                                   int list)
 {
     const SigMatchData *smd = NULL;
     const DetectThresholdData *tsh = NULL;
@@ -128,9 +127,6 @@ const DetectThresholdData *SigGetThresholdTypeIter(const Signature *sig,
         smd = *psm;
     }
 
-    if (p == NULL)
-        return NULL;
-
     while (1) {
         if (smd->type == DETECT_THRESHOLD ||
             smd->type == DETECT_DETECTION_FILTER)
index 9bab025de7dbb8e29b4ed5eaa3b7cdf0803d19a1..0a631f13d6dd967f79b2d9d28d40e88fbb5e3067 100644 (file)
@@ -37,7 +37,7 @@ int ThresholdHostHasThreshold(Host *);
 int ThresholdIPPairHasThreshold(IPPair *pair);
 
 const DetectThresholdData *SigGetThresholdTypeIter(const Signature *,
-        Packet *, const SigMatchData **, int list);
+        const SigMatchData **, int list);
 int PacketAlertThreshold(DetectEngineCtx *, DetectEngineThreadCtx *,
         const DetectThresholdData *, Packet *,
         const Signature *, PacketAlert *);