Skip to content

Commit

Permalink
Fix flow counter in sort list. #575
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Nov 10, 2024
1 parent c1db0ce commit ad15f25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/nfdump/nflowcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/nfpcapd/nfpcapd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libgen.h>

#include "config.h"
Expand Down

0 comments on commit ad15f25

Please sign in to comment.