Commit c5d7cc29 authored by Håvard Moås's avatar Håvard Moås
Browse files

Update IPFIXLIB to _really_ fix the error in bitrate calculation. Now not...

Update IPFIXLIB to _really_ fix the error in bitrate calculation. Now not crashing on very special packet sizes, havard.mork@gmail.com

git-svn-id: file:///home/svn/mapi/branches/haavardm-mapi@39 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent a6cdc2a4
......@@ -418,14 +418,9 @@ static void calculateBitrate(u_int is_min, u_int divisor, unsigned long long sta
}
else if(numSlotsAdvance > 0) {
// Advance a given number of slots
for(i=0; i<(BITRATE_AVERAGER_SLOTS-numSlotsAdvance); i++)
averager[i] = averager[i+numSlotsAdvance];
for(i=(BITRATE_AVERAGER_SLOTS-numSlotsAdvance); i<BITRATE_AVERAGER_SLOTS; i++)
averager[i] = 0;
/*
memmove(averager,averager + numSlotsAdvance, sizeof(u_int32_t)*(BITRATE_AVERAGER_SLOTS-numSlotsAdvance));
memset(averager + (BITRATE_AVERAGER_SLOTS-numSlotsAdvance), '\0', numSlotsAdvance*sizeof(u_int32_t));
averager[lastslot] = 0;*/
// averager[lastslot] = 0;
}
averager[lastslot] += len;
}
......
......@@ -1304,7 +1304,7 @@ turnOnSpecialProcessing(np_ctxt_t *npctxt, u_int element) {
// Maximum size of packets sent to collector.
// Should not exceed platform's MTU.
// Add around 64 bytes of NetFlow header.
#define UDP_FLOWSET_MTU 1400
#define UDP_FLOWSET_MTU 1380
void
compileTemplate(np_ctxt_t *npctxt, char *_fmt,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment