From: Jeff Lucovsky Date: Sun, 26 Jul 2020 18:21:18 +0000 (-0400) Subject: output/flow: Eliminate unnecessary parameter X-Git-Tag: suricata-6.0.0-beta1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60658cbe0161b4e448a336e21e6f28828887f2b1;p=thirdparty%2Fsuricata.git 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. --- 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; }