Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next/502/20240624/v1 #11365

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/detect-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,6 @@ static int DetectEngineInspectRulePayloadMatches(
if (p->flags & PKT_DETECT_HAS_STREAMDATA) {
pmatch = DetectEngineInspectStreamPayload(de_ctx, det_ctx, s, p->flow, p);
if (pmatch) {
det_ctx->flags |= DETECT_ENGINE_THREAD_CTX_STREAM_CONTENT_MATCH;
*alert_flags |= PACKET_ALERT_FLAG_STREAM_MATCH;
}
}
Expand Down
9 changes: 3 additions & 6 deletions src/detect-nfs-procedure.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
dd = DetectNfsProcedureParse(rawstr);
if (dd == NULL) {
SCLogError("Parsing \'%s\' failed", rawstr);
goto error;
return -1;
}

/* okay so far so good, lets get this into a SigMatch
Expand All @@ -171,13 +171,10 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
SCLogDebug("low %u hi %u", dd->arg1, dd->arg2);
if (SigMatchAppendSMToList(de_ctx, s, DETECT_AL_NFS_PROCEDURE, (SigMatchCtx *)dd,
g_nfs_request_buffer_id) == NULL) {
goto error;
DetectNfsProcedureFree(de_ctx, dd);
return -1;
}
return 0;

error:
DetectNfsProcedureFree(de_ctx, dd);
return -1;
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,6 @@ static inline void DetectRulePacketRules(
DetectVarProcessList(det_ctx, pflow, p);
DetectReplaceFree(det_ctx);
RULE_PROFILING_END(det_ctx, s, smatch, p);

det_ctx->flags = 0;
continue;
}
}
Expand Down Expand Up @@ -1731,7 +1729,6 @@ static void DetectRunFrames(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngin
DetectRunPostMatch(tv, det_ctx, p, s);

uint8_t alert_flags = (PACKET_ALERT_FLAG_STATE_MATCH | PACKET_ALERT_FLAG_FRAME);
det_ctx->flags |= DETECT_ENGINE_THREAD_CTX_FRAME_ID_SET;
det_ctx->frame_id = frame->id;
SCLogDebug(
"%p/%" PRIi64 " sig %u (%u) matched", frame, frame->id, s->id, s->num);
Expand Down
5 changes: 0 additions & 5 deletions src/detect.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ typedef struct DetectPort_ {
/* for now a uint8_t is enough */
#define SignatureMask uint8_t

#define DETECT_ENGINE_THREAD_CTX_FRAME_ID_SET 0x0001
#define DETECT_ENGINE_THREAD_CTX_STREAM_CONTENT_MATCH 0x0004

#define FILE_SIG_NEED_FILE 0x01
#define FILE_SIG_NEED_FILENAME 0x02
#define FILE_SIG_NEED_MAGIC 0x04 /**< need the start of the file */
Expand Down Expand Up @@ -1180,8 +1177,6 @@ typedef struct DetectEngineThreadCtx_ {
uint32_t *to_clear_queue;
} multi_inspect;

uint16_t flags; /**< DETECT_ENGINE_THREAD_CTX_* flags */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I wish we had tools like rust to find these...


/* true if tx_id is set */
bool tx_id_set;
/** ID of the transaction currently being inspected. */
Expand Down
Loading