]> 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)
committerVictor Julien <victor@inliniac.net>
Fri, 4 Jun 2021 08:36:49 +0000 (10:36 +0200)
Remove packet pointer from SigGetThresholdTypeIter() as it is
unused.

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 5856406c65bc07d90bad9aab1b781f1e3b86de40..09aaacde9107d6f70388b683fd5326809b786340 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 b55c1d2c13bbf423b2833f0e210d3f1d0d08390e..5f7196e81e348490f5c66c37748e796751f4e58d 100644 (file)
@@ -38,7 +38,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 *);