From: Mats Klepsland Date: Thu, 27 May 2021 08:59:36 +0000 (+0200) Subject: thresholds: remove unneeded function argument X-Git-Tag: suricata-6.0.3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4db179f2a396bb5a4c4d88e6fe90c4d5bf205e5a;p=thirdparty%2Fsuricata.git thresholds: remove unneeded function argument Remove packet pointer from SigGetThresholdTypeIter() as it is unused. (cherry picked from commit b0b4fab7949dddeaf4c1b844c403dcc2c2470595) --- diff --git a/src/detect-engine-alert.c b/src/detect-engine-alert.c index f570fe94f9..90713facc5 100644 --- a/src/detect-engine-alert.c +++ b/src/detect-engine-alert.c @@ -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); diff --git a/src/detect-engine-threshold.c b/src/detect-engine-threshold.c index eff4fe4f6b..9c021a8256 100644 --- a/src/detect-engine-threshold.c +++ b/src/detect-engine-threshold.c @@ -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) diff --git a/src/detect-engine-threshold.h b/src/detect-engine-threshold.h index 9bab025de7..0a631f13d6 100644 --- a/src/detect-engine-threshold.h +++ b/src/detect-engine-threshold.h @@ -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 *);