[flow-tools] flow-tag connondrum

Horatio B. Bogbindero wyy@admu.edu.ph
Tue, 21 May 2002 09:55:20 +0800


this is the gdb snapshot of the tag attempt that failed.

Breakpoint 1, main (argc=4, argv=0xbffffb54) at flow-tag.c:174
174         fttag_eval(&fttag, rec_in, &rec_out);
(gdb) s
fttag_eval (fttag=0xbffff640, rec_in=0x806a468, rec_out=0xbffff660)
    at fttag.c:1367
1367      if (fttag->flags & FT_TAG_DEF_ACTIVE_HASH) {
(gdb) n
1390      if (fttag->flags & FT_TAG_DEF_ACTIVE_DEFAULT) {
(gdb) n
1393        FT_SLIST_FOREACH(ftel, &fttag->default_defs, chain) {
(gdb) n
1394          eval2(ftel, rec_in, rec_out);
(gdb) s
eval2 (ftel=0x806a418, rec_in=0x806a468, rec_out=0xbffff660) at fttag.c:1184
1184      bzero(&dst_sock, sizeof dst_sock);
(gdb) n
1185      ftd = ftel->def;
(gdb) n
1187      if (ftd->flags & FT_TAG_DEF_FILTER_INPUT) {
(gdb) n
1194      if (ftd->flags & FT_TAG_DEF_FILTER_OUTPUT) {
(gdb) n
1196        if (!ftd->out_tbl[rec_in->output])
(gdb) n
1197          return 0;
(gdb) 


it is at this last structure "if (!ftd->out_tbl[rec_in->output])" that the 
magic happens. for those that are tagged properly this structure returns 
false for those that are improperly tagged this structure returns true. 

the contents of ftd->out_tbl = "\001\000\001", '\000' <repeats 65532 times>
the content of rec_in->output for the successfully tagged flow is 2 and for 
the unsuccessful one it is 12. 

i could go any future because i have no idea currently on what this piece 
of code does? maybe somebody can help me see what wrong here. or what does 
this structure do?

-------------------------------------------
William Emmanuel S. Yu
Ateneo Campus Network Group (AteneoCNG)
email  :  wyu at ateneo dot edu
web    :  http://CNG.ateneo.net/wyu/
phone  :  +63(2)4266001-4186
GPG    :  http://CNG.ateneo.net/wyu/wyy.pgp