[maf@eng.oar.net: Re: [flow-tools] some bugs in flow-tools-0.58]
Mark Fullmer
maf@eng.oar.net
Mon, 17 Jun 2002 10:51:41 -0400
On Mon, Jun 17, 2002 at 09:51:36AM +0800, Horatio B. Bogbindero wrote:
> >
> the patch fixed the dst/src problem. however, it did not fix the segmentation
> fault problem. pardon my ignorance but how do i get a backtrace in C? java
> automagically traces. hehehe.
With gdb "bt"
> although, attached is the last thing i saw when running gdb. it is not much
> but at least we can see were it did a segmentation fault. although, the queer
> thing is that there was no core dump.
It was enough to see the problem. Patch follows.
> cripes! so that is what it does. how do i do a get all flows from 1:00 - 4:00
> on all the flows. i need this for our billing systems that divides usage by
> shifts. that particular 1:00-4:00am is cheap time. however, is it possible
> to remove that 1:00 today to 1:00 anyday?
What I'll probably do is change the current "time" primitive to "time-date"
and then implement a new "time" primitive that matches on hour:min:second.
Index: ftfil.c
===================================================================
RCS file: /usr/home/djnz-cvsroot/flow-tools/lib/ftfil.c,v
retrieving revision 1.3
diff -r1.3 ftfil.c
1386c1386,1387
< hash = (*src_tag>>16) ^ (*src_tag & 0x0FFF);
---
> hash = (*src_tag>>16) ^ (*src_tag & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1419c1420,1421
< hash = (*dst_tag>>16) ^ (*dst_tag & 0x0FFF);
---
> hash = (*dst_tag>>16) ^ (*dst_tag & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1528c1530,1531
< hash = (*nexthop>>16) ^ (*nexthop & 0x0FFF);
---
> hash = (*nexthop>>16) ^ (*nexthop & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1636c1639,1640
< hash = (*sc>>16) ^ (*sc & 0x0FFF);
---
> hash = (*sc>>16) ^ (*sc & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1744c1748,1749
< hash = (*src_ip_addr>>16) ^ (*src_ip_addr & 0x0FFF);
---
> hash = (*src_ip_addr>>16) ^ (*src_ip_addr & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1852c1857,1858
< hash = (*dst_ip_addr>>16) ^ (*dst_ip_addr & 0x0FFF);
---
> hash = (*dst_ip_addr>>16) ^ (*dst_ip_addr & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
1960c1966,1967
< hash = (*exporter_ip_addr>>16) ^ (*exporter_ip_addr & 0x0FFF);
---
> hash = (*exporter_ip_addr>>16) ^ (*exporter_ip_addr & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
3125c3132,3133
< hash = (ftch_recfc32.c32>>16) ^ (ftch_recfc32.c32 & 0x0FFF);
---
> hash = (ftch_recfc32.c32>>16) ^ (ftch_recfc32.c32 & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));
3186c3194,3195
< hash = (ftch_recfc32.c32>>16) ^ (ftch_recfc32.c32 & 0x0FFF);
---
> hash = (ftch_recfc32.c32>>16) ^ (ftch_recfc32.c32 & 0xFFFF);
> hash = ((hash >>8) ^ (hash & 0x0FFF));