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

Update IPFIXLIB to fix another error relating to new bandwidth calculation, havard.mork@gmail.com

git-svn-id: file:///home/svn/mapi/branches/haavardm-mapi@50 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 0b9967e5
......@@ -414,7 +414,7 @@ static void calculateBitrate(u_int divisor, u_int64_t stamp, u_int64_t *lastupda
// First: If advancing, then sum up and check for record first.
if(numSlotsAdvance > 0 || force) {
u_int32_t sum = 0;
u_int32_t sum = 0, u_int32_t sum2 = 0;
for(i=0; i<BITRATE_AVERAGER_SLOTS; i++) {
sum += averager[i];
......@@ -425,11 +425,13 @@ static void calculateBitrate(u_int divisor, u_int64_t stamp, u_int64_t *lastupda
break;
}
}
sum *= mult;
if(sum < *rate_best_min)
*rate_best_min = sum;
if(sum!=MAX_UINT32 && sum > *rate_best_max)
*rate_best_max = sum;
// Retain 'sum', we need to know if its MAX_UINT32.
sum2 = sum*mult;
if(sum2 < *rate_best_min)
*rate_best_min = sum2;
if(sum!=MAX_UINT32 && sum2 > *rate_best_max)
*rate_best_max = sum2;
/* If 'force', then all we wanted was to update stats */
if(force)
......
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