From 10d4666d0958d6d73e56d67e6664a0647a61b73c Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Fri, 9 Aug 2024 09:52:56 +0200 Subject: [PATCH] Fix #554 - code dump in new processing pipeline. --- src/libnfdump/filter/filter.c | 2 +- src/nfdump/nfdump.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libnfdump/filter/filter.c b/src/libnfdump/filter/filter.c index a8cd26f9..e879d2fe 100644 --- a/src/libnfdump/filter/filter.c +++ b/src/libnfdump/filter/filter.c @@ -612,7 +612,7 @@ static void InitFilter(void) { void FilterSetParam(void *engine, const char *ident, const int hasGeoDB) { FilterEngine_t *filterEngine = (FilterEngine_t *)engine; filterEngine->hasGeoDB = hasGeoDB; - filterEngine->ident = ident; + filterEngine->ident = ident ? ident : "none"; } // End of FilterSetParam void *FilterCloneEngine(void *engine) { diff --git a/src/nfdump/nfdump.c b/src/nfdump/nfdump.c index f1c38d01..95b640ec 100644 --- a/src/nfdump/nfdump.c +++ b/src/nfdump/nfdump.c @@ -289,7 +289,10 @@ __attribute__((noreturn)) static void *prepareThread(void *arg) { int done = nffile == NULL; while (!done) { - if (dataHandle == NULL) dataHandle = calloc(1, sizeof(dataHandle_t)); + if (dataHandle == NULL) { + dataHandle = calloc(1, sizeof(dataHandle_t)); + dataHandle->ident = nffile->ident; + } dataHandle->dataBlock = ReadBlock(nffile, NULL); // get next data block from file @@ -300,7 +303,6 @@ __attribute__((noreturn)) static void *prepareThread(void *arg) { } else { if (nffile->stat_record->firstseen < t_first_flow) t_first_flow = nffile->stat_record->firstseen; if (nffile->stat_record->lastseen > t_last_flow) t_last_flow = nffile->stat_record->lastseen; - dataHandle->ident = nffile->ident; } continue; }