From c1673908ac47449294fce3e028b3f8261f4e40f0 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 10 Jul 2020 15:31:24 +0200 Subject: [PATCH] eve/alert: minor cleanups --- src/output-json-alert.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/output-json-alert.c b/src/output-json-alert.c index b136fca05c..070e27f276 100644 --- a/src/output-json-alert.c +++ b/src/output-json-alert.c @@ -530,12 +530,10 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p) MemBuffer *payload = aft->payload_buffer; AlertJsonOutputCtx *json_output_ctx = aft->json_output_ctx; - int i; - if (p->alerts.cnt == 0 && !(p->flags & PKT_HAS_TAG)) return TM_ECODE_OK; - for (i = 0; i < p->alerts.cnt; i++) { + for (int i = 0; i < p->alerts.cnt; i++) { const PacketAlert *pa = &p->alerts.alerts[i]; if (unlikely(pa->s == NULL)) { continue; @@ -596,9 +594,7 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p) if (json_output_ctx->flags & LOG_JSON_RULE_METADATA) { AlertAddFiles(p, jb, pa->tx_id); } - } - if (p->flow) { EveAddAppProto(p->flow, jb); if (json_output_ctx->flags & LOG_JSON_FLOW) { jb_open_object(jb, "flow"); -- 2.47.2