diff --git a/src/nfdump/nflowcache.c b/src/nfdump/nflowcache.c index 4003836d..dbb41216 100755 --- a/src/nfdump/nflowcache.c +++ b/src/nfdump/nflowcache.c @@ -1610,9 +1610,15 @@ static inline void PrintSortList(SortElement_t *SortList, uint64_t maxindex, out genericFlow->tcpFlags = flowRecord->inFlags; EXcntFlow_t tmpCntFlow = {0}; - if (cntFlow == NULL && (flowRecord->flows > 1 || flowRecord->outPackets)) { - recordHandle.extensionList[EXcntFlowID] = &tmpCntFlow; - cntFlow = &tmpCntFlow; + if (cntFlow == NULL) { + if (flowRecord->flows > 1 || flowRecord->outPackets) { + recordHandle.extensionList[EXcntFlowID] = &tmpCntFlow; + cntFlow = &tmpCntFlow; + cntFlow->outPackets = flowRecord->outPackets; + cntFlow->outBytes = flowRecord->outBytes; + cntFlow->flows = flowRecord->flows; + } + } else { cntFlow->outPackets = flowRecord->outPackets; cntFlow->outBytes = flowRecord->outBytes; cntFlow->flows = flowRecord->flows; diff --git a/src/nfpcapd/nfpcapd.c b/src/nfpcapd/nfpcapd.c index 99577cdd..4d2284e6 100755 --- a/src/nfpcapd/nfpcapd.c +++ b/src/nfpcapd/nfpcapd.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "config.h"