From 43aed70976762a9e80c0938603c5ccdf4974abde Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 5 Oct 2016 10:19:01 +0200 Subject: [PATCH] detect: during detection sgh is read only so turn into const --- src/detect-engine-state.c | 2 +- src/detect.c | 2 +- src/detect.h | 2 +- src/flow.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index a42ec82b17..46ff40c825 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -255,7 +255,7 @@ static void DeStateStoreFileNoMatchCnt(DetectEngineState *de_state, uint16_t fil return; } -static int DeStateStoreFilestoreSigsCantMatch(SigGroupHead *sgh, DetectEngineState *de_state, uint8_t direction) +static int DeStateStoreFilestoreSigsCantMatch(const SigGroupHead *sgh, DetectEngineState *de_state, uint8_t direction) { if (de_state->dir_state[direction & STREAM_TOSERVER ? 0 : 1].filestore_cnt == sgh->filestore_cnt) return 1; diff --git a/src/detect.c b/src/detect.c index e916ee5354..bf26a97f81 100644 --- a/src/detect.c +++ b/src/detect.c @@ -993,7 +993,7 @@ DetectPostInspectFileFlagsUpdate(Flow *pflow, const SigGroupHead *sgh, uint8_t d } static inline void -DetectPostInspectFirstSGH(const Packet *p, Flow *pflow, SigGroupHead *sgh) +DetectPostInspectFirstSGH(const Packet *p, Flow *pflow, const SigGroupHead *sgh) { if ((p->flowflags & FLOW_PKT_TOSERVER) && !(pflow->flags & FLOW_SGH_TOSERVER)) { /* first time we see this toserver sgh, store it */ diff --git a/src/detect.h b/src/detect.h index a1b266ca64..2a84d51f0a 100644 --- a/src/detect.h +++ b/src/detect.h @@ -893,7 +893,7 @@ typedef struct DetectEngineThreadCtx_ { SigIntId de_state_sig_array_len; uint8_t *de_state_sig_array; - struct SigGroupHead_ *sgh; + const struct SigGroupHead_ *sgh; SignatureNonPrefilterStore *non_pf_store_ptr; uint32_t non_pf_store_cnt; diff --git a/src/flow.h b/src/flow.h index 540ef9d992..044f61e1d3 100644 --- a/src/flow.h +++ b/src/flow.h @@ -404,10 +404,10 @@ typedef struct Flow_ /** toclient sgh for this flow. Only use when FLOW_SGH_TOCLIENT flow flag * has been set. */ - struct SigGroupHead_ *sgh_toclient; + const struct SigGroupHead_ *sgh_toclient; /** toserver sgh for this flow. Only use when FLOW_SGH_TOSERVER flow flag * has been set. */ - struct SigGroupHead_ *sgh_toserver; + const struct SigGroupHead_ *sgh_toserver; /* pointer to the var list */ GenericVar *flowvar; -- 2.47.2