]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: during detection sgh is read only so turn into const 2343/head
authorVictor Julien <victor@inliniac.net>
Wed, 5 Oct 2016 08:19:01 +0000 (10:19 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 7 Oct 2016 08:24:27 +0000 (10:24 +0200)
src/detect-engine-state.c
src/detect.c
src/detect.h
src/flow.h

index a42ec82b17bc9b2eb5619be7d27e2faa1564192d..46ff40c825f9d58c77287b1b7ff566f313f6014e 100644 (file)
@@ -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;
index e916ee5354e7bad322a94c745ab9857f4ea3ad6d..bf26a97f81e39d197c19e9fa1afe11808051dd8c 100644 (file)
@@ -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 */
index a1b266ca644ee76cfc47f1b0c18b87f9001e58b3..2a84d51f0a3db4d9ad7196b15bba524d35e12def 100644 (file)
@@ -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;
index 540ef9d9926b8bd3a71afe81dbe7e8f1f9baa1ce..044f61e1d3d804678f8933ca290c31beb4d043ae 100644 (file)
@@ -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;