From 9965ceb9853ae6dd66e067536d3f79351951baaf Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Fri, 19 Jul 2024 06:37:37 +0200 Subject: [PATCH] Fix AS mmdb lookup for flow addregation --- src/nfdump/nflowcache.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/nfdump/nflowcache.c b/src/nfdump/nflowcache.c index 40f28add..6858c6bc 100755 --- a/src/nfdump/nflowcache.c +++ b/src/nfdump/nflowcache.c @@ -747,11 +747,19 @@ static inline int New_HashKey(void *keymem, recordHandle_t *recordHandle, int sw } aggregate_param_t *param = &aggregationTable[tableIndex].param; + uint8_t local[128]; void *inPtr = recordHandle->extensionList[param->extID]; - if (inPtr == NULL) continue; - inPtr += param->offset; - preprocess_t preprocess = aggregationTable[tableIndex].preprocess; + if (inPtr == NULL) { + if (preprocess != NOPREPROCESS) { + inPtr = (void *)local; + memset((void *)local, 0, sizeof(local)); + } else { + continue; + } + } else { + inPtr += param->offset; + } PreProcess(inPtr, preprocess, recordHandle); keyLen += param->length;