From b0b4fab7949dddeaf4c1b844c403dcc2c2470595 Mon Sep 17 00:00:00 2001 From: Mats Klepsland Date: Thu, 27 May 2021 10:59:36 +0200 Subject: [PATCH] thresholds: remove unneeded function argument Remove packet pointer from SigGetThresholdTypeIter() as it is unused. --- src/detect-engine-alert.c | 4 ++-- src/detect-engine-threshold.c | 14 +++++--------- src/detect-engine-threshold.h | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) 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 5856406c65..09aaacde91 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 b55c1d2c13..5f7196e81e 100644 --- a/src/detect-engine-threshold.h +++ b/src/detect-engine-threshold.h @@ -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 *); -- 2.47.2