From 60658cbe0161b4e448a336e21e6f28828887f2b1 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sun, 26 Jul 2020 14:21:18 -0400 Subject: [PATCH] output/flow: Eliminate unnecessary parameter This commit removes a parameter to an internal-only function call. Removing the parameter allows an JSON builder optimization to be used. --- src/output-json-flow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/output-json-flow.c b/src/output-json-flow.c index 6fc22ce1f3..8faccc73da 100644 --- a/src/output-json-flow.c +++ b/src/output-json-flow.c @@ -63,7 +63,7 @@ typedef struct JsonFlowLogThread_ { MemBuffer *buffer; } JsonFlowLogThread; -static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_type) +static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f) { char timebuf[64]; char srcip[46] = {0}, dstip[46] = {0}; @@ -118,9 +118,7 @@ static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_typ jb_set_string(jb, "in_iface", f->livedev->dev); } - if (event_type) { - jb_set_string(jb, "event_type", event_type); - } + JB_SET_STRING(jb, "event_type", "flow"); /* vlan */ if (f->vlan_idx > 0) { @@ -333,7 +331,7 @@ static int JsonFlowLogger(ThreadVars *tv, void *thread_data, Flow *f) /* reset */ MemBufferReset(jhl->buffer); - JsonBuilder *jb = CreateEveHeaderFromFlow(f, "flow"); + JsonBuilder *jb = CreateEveHeaderFromFlow(f); if (unlikely(jb == NULL)) { return TM_ECODE_OK; }