detect/analyzer: fix pkt engine display

pull/5931/head
Victor Julien 4 years ago
parent f037f6f4ff
commit 52692da7cf

@ -1415,14 +1415,14 @@ bool DetectEnginePktInspectionRun(ThreadVars *tv,
/** /**
* \param data pointer to SigMatchData. Allowed to be NULL. * \param data pointer to SigMatchData. Allowed to be NULL.
*/ */
static int DetectEnginePktInspectionAppend(Signature *s, static int DetectEnginePktInspectionAppend(Signature *s, InspectionBufferPktInspectFunc Callback,
InspectionBufferPktInspectFunc Callback, SigMatchData *data, const int list_id)
SigMatchData *data)
{ {
DetectEnginePktInspectionEngine *e = SCCalloc(1, sizeof(*e)); DetectEnginePktInspectionEngine *e = SCCalloc(1, sizeof(*e));
if (e == NULL) if (e == NULL)
return -1; return -1;
e->sm_list = list_id;
e->v1.Callback = Callback; e->v1.Callback = Callback;
e->smd = data; e->smd = data;
@ -1442,15 +1442,15 @@ int DetectEnginePktInspectionSetup(Signature *s)
{ {
/* only handle PMATCH here if we're not an app inspect rule */ /* only handle PMATCH here if we're not an app inspect rule */
if (s->sm_arrays[DETECT_SM_LIST_PMATCH] && (s->init_data->init_flags & SIG_FLAG_INIT_STATE_MATCH) == 0) { if (s->sm_arrays[DETECT_SM_LIST_PMATCH] && (s->init_data->init_flags & SIG_FLAG_INIT_STATE_MATCH) == 0) {
if (DetectEnginePktInspectionAppend(s, DetectEngineInspectRulePayloadMatches, if (DetectEnginePktInspectionAppend(
NULL) < 0) s, DetectEngineInspectRulePayloadMatches, NULL, DETECT_SM_LIST_PMATCH) < 0)
return -1; return -1;
SCLogDebug("sid %u: DetectEngineInspectRulePayloadMatches appended", s->id); SCLogDebug("sid %u: DetectEngineInspectRulePayloadMatches appended", s->id);
} }
if (s->sm_arrays[DETECT_SM_LIST_MATCH]) { if (s->sm_arrays[DETECT_SM_LIST_MATCH]) {
if (DetectEnginePktInspectionAppend(s, DetectEngineInspectRulePacketMatches, if (DetectEnginePktInspectionAppend(
NULL) < 0) s, DetectEngineInspectRulePacketMatches, NULL, DETECT_SM_LIST_MATCH) < 0)
return -1; return -1;
SCLogDebug("sid %u: DetectEngineInspectRulePacketMatches appended", s->id); SCLogDebug("sid %u: DetectEngineInspectRulePacketMatches appended", s->id);
} }

Loading…
Cancel
Save