Skip to content

Commit

Permalink
detect: during detection sgh is read only so turn into const
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Oct 7, 2016
1 parent 0e31124 commit 43aed70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/detect-engine-state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/detect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 43aed70

Please sign in to comment.