[flow-tools] patch for support.c
Paul Lustgraaf
grpjl@iastate.edu
Tue, 25 Sep 2001 10:00:34 CDT
I just recently upgraded from version 0.32 to version 0.55.
I've been plagued by segmentation faults in flow-stats since.
Anyway, I traced them down and it appears to be coming from routine
sort_64uint64 in support.c.
I seem to have fixed it by the following change:
diff support.c.old support.c
342,343c342,343
< while (a[index[++i]] < v);
< while (a[index[--j]] > v);
---
> while ((a[index[++i]] < v) & (i < r));
> while ((a[index[--j]] > v) & (j > 0));
I think the j>0 test is the critical one. The i<r test is an
optimization I learned somewhere, perhaps Knuth's book on sorting.
I really appreciate the simplicity of flow-tools. It has avoided the
creeping featuritis of some of the other Netflow tools. It enables
an old Fortran hack like me to understand what it is doing.
Paul Lustgraaf "Change is inevitable. Progress is not."
Manager of Network Services
Iowa State University Academic Information Technologies grpjl@iastate.edu
Ames, IA 50011 515-294-0324