[flow-tools] Intermittent Header Bug in ftio.c ; recommended fix?

Dutky, Steve steve.dutky@tfn.com
Tue, 4 Jun 2002 19:17:09 -0400


Please note varible flags referenced before it is initialized:

void ftio_header_print(struct ftio *ftio, FILE *std, char cc)
{
  struct ftiheader *fth;
  struct ftmap_ifname *ftmin;
  struct ftmap_ifalias *ftmia;
  char agg_ver, agg_method;
  char *agg_name;
  char fmt_buf[32];
  u_int32 flags, fields;
  u_long period;
  int n, streaming2;

  fth = &ftio->fth;

  fields = ftio->fth.fields;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  streaming2 = (flags & FT_HEADER_FLAG_STREAMING);
  if (flags & FT_HEADER_FLAG_PRELOADED)
    streaming2 = 0;

  if (fields & FT_FIELD_HEADER_FLAGS)
    flags = ftio->fth.flags;
  else
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...
from ftio.c


results in most of the time:
$ flow-stat -p <./flow/2002/2002-06/2002-06-04/ft-v05.2002-06-04.091501-0400
>
#  --- ---- ---- Report Information --- --- ---
#
# Fields:    Total
# Symbols:   Disabled
# Sorting:   None
# Name:      Overall Summary
#
# Args:      flow-stat -p 
#
#
# mode:                 normal
# capture hostname:     admin1
# exporter IP address:  0.0.0.0
# capture start:        Tue Jun  4 09:15:01 2002
# capture end:          Tue Jun  4 09:30:01 2002
# capture period:       900 seconds
# compress:             off
# byte order:           big
# stream version:       3
# export version:       5
# lost flows:           0
# corrupt packets:      0
# sequencer resets:     0
# capture flows:        23010
#


but sometimes:

$ flow-stat -p <./flow/2002/2002-06/2002-06-04/ft-v05.2002-06-04.091501-0400
>
#  --- ---- ---- Report Information --- --- ---
#
# Fields:    Total
# Symbols:   Disabled
# Sorting:   None
# Name:      Overall Summary
#
# Args:      flow-stat -p 
#
#
# mode:                 normal
# capture hostname:     admin1
# exporter IP address:  0.0.0.0
# compress:             off
# byte order:           big
# stream version:       3
# export version:       5
#


thanks, Steve Dutky
301-545-4113