summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Walker <ka0ttic@gentoo.org>2005-01-27 10:33:03 +0000
committerAaron Walker <ka0ttic@gentoo.org>2005-01-27 10:33:03 +0000
commite42d87cd810c1e4716b46973ce46b84c005ccc33 (patch)
tree6a2ba22c23e2b63446d7e7c9ed62f8691d684096 /net-analyzer/flow-tools/files
parentStable on x86. Shaped up DEPEND a bit. (diff)
downloadgentoo-2-e42d87cd810c1e4716b46973ce46b84c005ccc33.tar.gz
gentoo-2-e42d87cd810c1e4716b46973ce46b84c005ccc33.tar.bz2
gentoo-2-e42d87cd810c1e4716b46973ce46b84c005ccc33.zip
Added a sleu of patches: gcc-3.4 fixes, fixes of 99% of the *many* compiler warnings, and configure.in fixes so that --with-XXX and --without-XXX work properly - bug 79652. Also updated nodebug and memleak patches so that they can be applied from ${S}.
(Portage version: 2.0.51-r15)
Diffstat (limited to 'net-analyzer/flow-tools/files')
-rw-r--r--net-analyzer/flow-tools/files/flow-tools-0.67-fix-a-zillion-warnings.diff669
-rw-r--r--net-analyzer/flow-tools/files/flow-tools-0.67-fix-configure.diff150
-rw-r--r--net-analyzer/flow-tools/files/flow-tools-0.67-gcc34.diff52
-rw-r--r--net-analyzer/flow-tools/files/flow-tools-0.67-memleak.patch13
-rw-r--r--net-analyzer/flow-tools/files/flow-tools-0.67-nodebug.patch19
5 files changed, 883 insertions, 20 deletions
diff --git a/net-analyzer/flow-tools/files/flow-tools-0.67-fix-a-zillion-warnings.diff b/net-analyzer/flow-tools/files/flow-tools-0.67-fix-a-zillion-warnings.diff
new file mode 100644
index 000000000000..2014d864f403
--- /dev/null
+++ b/net-analyzer/flow-tools/files/flow-tools-0.67-fix-a-zillion-warnings.diff
@@ -0,0 +1,669 @@
+diff -urN flow-tools-0.67.orig/lib/ftchash.c flow-tools-0.67/lib/ftchash.c
+--- flow-tools-0.67.orig/lib/ftchash.c 2005-01-27 02:45:08.860520536 -0500
++++ flow-tools-0.67/lib/ftchash.c 2005-01-27 02:45:23.927230048 -0500
+@@ -324,9 +324,10 @@
+ /* more entries in this chunk *? */
+ if ((char*)ftch->traverse_rec <
+ (char*)ftch->traverse_chunk->base+ftch->traverse_chunk->next) {
++ char *p = (char *)ftch->traverse_rec;
+
+ ret = ftch->traverse_rec;
+- (char*)ftch->traverse_rec += ftch->d_size;
++ p += ftch->d_size;
+ return ret;
+
+ } else {
+diff -urN flow-tools-0.67.orig/lib/ftfil.c flow-tools-0.67/lib/ftfil.c
+--- flow-tools-0.67.orig/lib/ftfil.c 2005-01-27 02:45:08.870519016 -0500
++++ flow-tools-0.67/lib/ftfil.c 2005-01-27 02:45:23.933229136 -0500
+@@ -2460,7 +2460,7 @@
+ struct stat sb;
+ struct jump *jmp;
+ struct line_parser lp;
+- int fd, ret, found;
++ int fd, ret, found = 0;
+ char *buf, *buf2, *c;
+
+ ret = -1;
+@@ -3020,7 +3020,7 @@
+ struct ftfil_primitive *ftfp;
+ struct ftfil_def *ftfd;
+ int type, found, valid;
+- void *eval;
++ void *eval = NULL;
+
+ /* foreach definition */
+ FT_SLIST_FOREACH(ftfd, &ftfil->defs, chain) {
+@@ -4947,7 +4947,7 @@
+ char *p, *q, *r, c;
+ int j, flag;
+ unsigned i, i2;
+- int permit,deny;
++ int permit = 0, deny = 0;
+ u_int32 val;
+
+ if (mode == FT_FIL_MODE_DENY) {
+diff -urN flow-tools-0.67.orig/lib/ftfile.c flow-tools-0.67/lib/ftfile.c
+--- flow-tools-0.67.orig/lib/ftfile.c 2005-01-27 02:45:08.874518408 -0500
++++ flow-tools-0.67/lib/ftfile.c 2005-01-27 02:45:23.936228680 -0500
+@@ -417,8 +417,9 @@
+ long gmt_val;
+ char gmt_sign;
+ int tm_gmtoff;
++ time_t _ftime = (time_t)ftime;
+
+- if (!(tm = localtime ((time_t*)&ftime))) {
++ if (!(tm = localtime (&_ftime))) {
+ snprintf(buf, bsize, ".");
+ }
+
+@@ -503,6 +504,7 @@
+ {
+ struct tm *tm;
+ char buf[32];
++ time_t _ftime = (time_t)ftime;
+
+ /* no directories */
+ if (nest == 0)
+@@ -512,7 +514,7 @@
+ if ((nest > 3) || (nest < -3))
+ return -1;
+
+- if (!(tm = localtime ((time_t*)&ftime)))
++ if (!(tm = localtime (&_ftime)))
+ return -1;
+
+ if (nest == -1)
+diff -urN flow-tools-0.67.orig/lib/ftio.c flow-tools-0.67/lib/ftio.c
+--- flow-tools-0.67.orig/lib/ftio.c 2005-01-27 02:45:08.861520384 -0500
++++ flow-tools-0.67/lib/ftio.c 2005-01-27 02:45:23.939228224 -0500
+@@ -2257,6 +2257,7 @@
+ {
+
+ int nleft, nread;
++ char *p = ptr;
+
+ nleft = nbytes;
+ while (nleft > 0) {
+@@ -2267,7 +2268,7 @@
+ break;
+
+ nleft -= nread;
+- (char*)ptr += nread;
++ p += nread;
+ }
+ return (nbytes - nleft);
+ } /* readn */
+@@ -2284,6 +2285,7 @@
+ {
+
+ int nleft, nwritten;
++ char *p = ptr;
+
+ nleft = nbytes;
+ while (nleft > 0) {
+@@ -2292,7 +2294,7 @@
+ return(nwritten); /* error */
+
+ nleft -= nwritten;
+- (char*)ptr += nwritten;
++ p += nwritten;
+ }
+ return(nbytes - nleft);
+ } /* writen */
+diff -urN flow-tools-0.67.orig/lib/ftmask.c flow-tools-0.67/lib/ftmask.c
+--- flow-tools-0.67.orig/lib/ftmask.c 2005-01-27 02:45:08.874518408 -0500
++++ flow-tools-0.67/lib/ftmask.c 2005-01-27 02:45:23.939228224 -0500
+@@ -134,7 +134,7 @@
+ struct stat sb;
+ struct jump *jmp;
+ struct line_parser lp;
+- int fd, ret, found;
++ int fd, ret, found = 0;
+ char *buf, *buf2, *c;
+
+ ret = -1;
+diff -urN flow-tools-0.67.orig/lib/ftstat.c flow-tools-0.67/lib/ftstat.c
+--- flow-tools-0.67.orig/lib/ftstat.c 2005-01-27 02:45:08.858520840 -0500
++++ flow-tools-0.67/lib/ftstat.c 2005-01-27 02:45:23.962224728 -0500
+@@ -151,7 +151,7 @@
+ struct A *B;\
+ struct tally tally;\
+ char fmt_buf1[32], fmt_buf[1024];\
+- int len, fmt, sort_flags, sort_offset, comma;\
++ int len, fmt, sort_flags, sort_offset = 0, comma;\
+ fmt = FMT_JUST_LEFT;\
+ fmt_buf1[0] = fmt_buf[0] = 0;\
+ bzero(&tally, sizeof tally);\
+@@ -633,7 +633,7 @@
+ struct fts3rec_all2 cur;\
+ struct A *B;\
+ u_int32 duration_tmp;\
+- double bps_tmp, pps_tmp;\
++ double bps_tmp = 0, pps_tmp = 0;\
+ B = rpt->data;\
+ STD_ACCUM;
+
+@@ -664,7 +664,7 @@
+ struct A *B;\
+ u_int32 hash;\
+ u_int32 duration_tmp;\
+- double bps_tmp, pps_tmp;\
++ double bps_tmp = 0, pps_tmp = 0;\
+ bzero(&D, sizeof D);\
+ B = rpt->data;\
+ STD_ACCUM;
+@@ -2729,7 +2729,7 @@
+ struct stat sb;
+ struct jump *jmp;
+ struct line_parser lp;
+- int fd, ret, found;
++ int fd, ret, found = 0;
+ char *buf, *buf2, *c;
+
+ ret = -1;
+@@ -3200,7 +3200,7 @@
+ struct ftstat_rpt_item *ftsrpti;
+ struct ftstat_rpt_out *ftsro;
+ int ret, noclose, pipe, status;
+- char fmt_tmp[64], fmt_buf[1024], path_buf[1024], *path_run;
++ char fmt_tmp[64], fmt_buf[1024], path_buf[1024], *path_run = NULL;
+ char *mode;
+
+ noclose = 0; /* fclose fp */
+diff -urN flow-tools-0.67.orig/lib/fttag.c flow-tools-0.67/lib/fttag.c
+--- flow-tools-0.67.orig/lib/fttag.c 2005-01-27 02:45:08.872518712 -0500
++++ flow-tools-0.67/lib/fttag.c 2005-01-27 02:45:23.964224424 -0500
+@@ -241,7 +241,7 @@
+ struct stat sb;
+ struct jump *jmp;
+ struct line_parser lp;
+- int fd, ret, found;
++ int fd, ret, found = 0;
+ char *buf, *buf2, *c;
+
+ ret = -1;
+@@ -1492,7 +1492,7 @@
+ struct fttag_def_term *ftdt;
+ struct fttag_def_term_actions *ftdta;
+ struct fttag_action *fta;
+- int i, found;
++ int i, found = 0;
+
+ /* foreach definition */
+ FT_SLIST_FOREACH(ftd, &fttag->defs, chain) {
+diff -urN flow-tools-0.67.orig/lib/fttlv.c flow-tools-0.67/lib/fttlv.c
+--- flow-tools-0.67.orig/lib/fttlv.c 2005-01-27 02:45:08.872518712 -0500
++++ flow-tools-0.67/lib/fttlv.c 2005-01-27 02:45:23.975222752 -0500
+@@ -55,6 +55,7 @@
+ int fttlv_enc_uint32(void *buf, int buf_size, int flip, u_int16 t, u_int32 v)
+ {
+ u_int16 len;
++ char *p = buf;
+
+ if (buf_size < 8)
+ return -1;
+@@ -67,13 +68,13 @@
+ SWAPINT32(v);
+ }
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(&v, buf, 4);
++ bcopy(&v, p, 4);
+
+ return 8;
+
+@@ -94,6 +95,7 @@
+ int fttlv_enc_uint16(void *buf, int buf_size, int flip, u_int16 t, u_int16 v)
+ {
+ u_int16 len;
++ char *p = buf;
+
+ if (buf_size < 6)
+ return -1;
+@@ -106,13 +108,13 @@
+ SWAPINT16(v);
+ }
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(&v, buf, 2);
++ bcopy(&v, p, 2);
+
+ return 6;
+
+@@ -133,6 +135,7 @@
+ int fttlv_enc_uint8(void *buf, int buf_size, int flip, u_int16 t, u_int8 v)
+ {
+ u_int16 len;
++ char *p = buf;
+
+ if (buf_size < 5)
+ return -1;
+@@ -144,13 +147,13 @@
+ SWAPINT16(len);
+ }
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(&v, buf, 1);
++ bcopy(&v, p, 1);
+
+ return 5;
+
+@@ -171,7 +174,8 @@
+ int fttlv_enc_str(void *buf, int buf_size, int flip, u_int16 t, char *v)
+ {
+ u_int16 len, len2;
+-
++ char *p = buf;
++
+ len = len2 = strlen(v)+1;
+
+ if (buf_size < 4+len)
+@@ -182,13 +186,13 @@
+ SWAPINT16(len);
+ }
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(v, buf, len);
++ bcopy(v, p, len);
+
+ return 4+len2;
+
+@@ -214,7 +218,8 @@
+ {
+ u_int16 len, len2;
+ int n;
+-
++ char *p = buf;
++
+ n = strlen(name)+1;
+
+ len = len2 = n+2+4;
+@@ -229,19 +234,19 @@
+ if (buf_size < 4+len)
+ return -1;
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(&ip, buf, 4);
+- (char*)buf += 4;
++ bcopy(&ip, p, 4);
++ p += 4;
+
+- bcopy(&ifIndex, buf, 2);
+- (char*)buf += 2;
++ bcopy(&ifIndex, p, 2);
++ p += 2;
+
+- bcopy(name, buf, n);
++ bcopy(name, p, n);
+
+ return 4+len2;
+
+@@ -267,6 +272,7 @@
+ {
+ u_int16 len, len2;
+ int n,i,esize;
++ char *p = buf;
+
+ n = strlen(name)+1;
+ esize = (entries*2);
+@@ -286,22 +292,22 @@
+ SWAPINT16(entries);
+ }
+
+- bcopy(&t, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&t, p, 2);
++ p += 2;
+
+- bcopy(&len, buf, 2);
+- (char*)buf+= 2;
++ bcopy(&len, p, 2);
++ p += 2;
+
+- bcopy(&ip, buf, 4);
+- (char*)buf += 4;
++ bcopy(&ip, p, 4);
++ p += 4;
+
+- bcopy(&entries, buf, 2);
+- (char*)buf += 2;
++ bcopy(&entries, p, 2);
++ p += 2;
+
+- bcopy(ifIndex_list, buf, esize);
+- (char*)buf += esize;
++ bcopy(ifIndex_list, p, esize);
++ p += esize;
+
+- bcopy(name, buf, n);
++ bcopy(name, p, n);
+
+ return 4+len2;
+
+diff -urN flow-tools-0.67.orig/lib/ftxlate.c flow-tools-0.67/lib/ftxlate.c
+--- flow-tools-0.67.orig/lib/ftxlate.c 2005-01-27 02:45:08.870519016 -0500
++++ flow-tools-0.67/lib/ftxlate.c 2005-01-27 02:45:23.977222448 -0500
+@@ -172,7 +172,7 @@
+ struct stat sb;
+ struct jump *jmp;
+ struct line_parser lp;
+- int fd, ret, found;
++ int fd, ret, found = 0;
+ char *buf, *buf2, *c;
+
+ ret = -1;
+@@ -1038,7 +1038,7 @@
+ struct ftxlate_def_term *ftxt;
+ struct ftxlate_def_term_actions *ftxta;
+ struct ftxlate_action *ftxa;
+- int found;
++ int found = 0;
+
+ /* foreach definition */
+ FT_SLIST_FOREACH(ftx, &ftxlate->defs, chain) {
+diff -urN flow-tools-0.67.orig/lib/radix.c flow-tools-0.67/lib/radix.c
+--- flow-tools-0.67.orig/lib/radix.c 2005-01-27 02:45:08.855521296 -0500
++++ flow-tools-0.67/lib/radix.c 2005-01-27 02:45:23.977222448 -0500
+@@ -902,6 +902,7 @@
+ rn_init(void)
+ {
+ char *cp, *cplim;
++ void **p = (void **)&mask_rnhead;
+ if (max_keylen == 0) {
+ printf("rn_init: radix functions require max_keylen be set\n");
+ return;
+@@ -912,7 +913,7 @@
+ addmask_key = cplim = rn_ones + max_keylen;
+ while (cp < cplim)
+ *cp++ = -1;
+- if (rn_inithead((void **)&mask_rnhead, 0) == 0)
++ if (rn_inithead(p, 0) == 0)
+ panic("rn_init 2");
+ }
+
+diff -urN flow-tools-0.67.orig/lib/support.c flow-tools-0.67/lib/support.c
+--- flow-tools-0.67.orig/lib/support.c 2005-01-27 02:45:08.861520384 -0500
++++ flow-tools-0.67/lib/support.c 2005-01-27 02:45:23.978222296 -0500
+@@ -286,7 +286,7 @@
+ struct in_addr *ina;
+ u_long addr = 0;
+ u_int n;
+- int dns, shift;
++ int dns, shift = 0;
+ char *t;
+
+ /* if there is anything ascii in here, this may be a hostname */
+@@ -627,6 +627,8 @@
+ {
+ char *c, *cs, *c2, *p, *p2;
+ int len, ret, done, nodir;
++
++ c = cs = c2 = p = p2 = NULL;
+
+ len = strlen(path);
+ c = (char*)0L;
+diff -urN flow-tools-0.67.orig/src/flow-capture.c flow-tools-0.67/src/flow-capture.c
+--- flow-tools-0.67.orig/src/flow-capture.c 2005-01-27 02:45:08.878517800 -0500
++++ flow-tools-0.67/src/flow-capture.c 2005-01-27 02:45:23.979222144 -0500
+@@ -145,7 +145,7 @@
+ struct ftpeeri ftpi;
+ struct ftver ftv;
+ struct ftchash *ftch;
+- struct ftchash_rec_exp ftch_recexp, *ftch_recexpp;
++ struct ftchash_rec_exp ftch_recexp, *ftch_recexpp = NULL;
+ struct rotate rot;
+ struct file cap_file;
+ struct fttag fttag;
+diff -urN flow-tools-0.67.orig/src/flow-cat.c flow-tools-0.67/src/flow-cat.c
+--- flow-tools-0.67.orig/src/flow-cat.c 2005-01-27 02:45:08.880517496 -0500
++++ flow-tools-0.67/src/flow-cat.c 2005-01-27 02:45:23.980221992 -0500
+@@ -65,14 +65,14 @@
+ struct ftset ftset;
+ struct ftfile_entries **fte;
+ struct ftfile_entry *fty;
+- int i, out_fd, out_fd_plain, in_fd, disable_mmap, in_fd_plain, sort;
++ int i, out_fd, out_fd_plain, in_fd, disable_mmap, in_fd_plain = 0, sort;
+ int fields;
+ int x, n, fd, flags, fte_entries, preload, time_filter;
+ char *fname, *out_fname;
+ char *rec;
+ u_long total_bytes;
+ u_int32 total_flows, lost_flows, corrupt_flows, total_streams;
+- u_int32 time_start, time_end, time_tmp1, time_tmp2, time_delta;
++ u_int32 time_start, time_end, time_tmp1 = 0, time_tmp2 = 0, time_delta;
+ u_int32 time_low, time_high;
+
+ /* init fterr */
+diff -urN flow-tools-0.67.orig/src/flow-dscan.c flow-tools-0.67/src/flow-dscan.c
+--- flow-tools-0.67.orig/src/flow-dscan.c 2005-01-27 02:45:08.880517496 -0500
++++ flow-tools-0.67/src/flow-dscan.c 2005-01-27 02:45:23.981221840 -0500
+@@ -618,8 +618,8 @@
+ {
+ FILE *FP;
+ int done;
+- struct dscan_rec *drp;
+- struct dscan_dst *ddp;
++ struct dscan_rec *drp = NULL;
++ struct dscan_dst *ddp = NULL;
+ char type;
+ char buf[1024];
+ u_int32 ip, hash, depth, flags, h, time, nports, i, j;
+diff -urN flow-tools-0.67.orig/src/flow-export.c flow-tools-0.67/src/flow-export.c
+--- flow-tools-0.67.orig/src/flow-export.c 2005-01-27 02:45:08.880517496 -0500
++++ flow-tools-0.67/src/flow-export.c 2005-01-27 02:50:09.946748472 -0500
+@@ -864,7 +864,7 @@
+ struct ftver ftv;
+ char fields[1024], values[1024], query[3*1024];
+ char *rec;
+- char *db_host, *db_name, *db_table, *db_user, *db_pwd, *db_tmp, *tmp;
++ char *db_host, *db_name, *db_table, *db_user, *db_pwd, *db_tmp = NULL, *tmp;
+ char *db_port;
+ int len;
+
+@@ -960,7 +960,7 @@
+
+ int fmt_xfields_type(char *buf, u_int64 xfield)
+ {
+- int comma;
++ int comma = 0;
+
+ buf[0] = 0;
+
+diff -urN flow-tools-0.67.orig/src/flow-fanout.c flow-tools-0.67/src/flow-fanout.c
+--- flow-tools-0.67.orig/src/flow-fanout.c 2005-01-27 02:45:08.882517192 -0500
++++ flow-tools-0.67/src/flow-fanout.c 2005-01-27 02:45:23.982221688 -0500
+@@ -100,8 +100,8 @@
+ struct tm *tm;
+ time_t now, time_startup;
+ fd_set rfd;
+- struct ip *ip_hdr;
+- struct udphdr *udp_hdr;
++ struct ip *ip_hdr = NULL;
++ struct udphdr *udp_hdr = NULL;
+ struct ftpeeri ftpi;
+ struct ftpdu ftpdu;
+ struct ftver ftv;
+diff -urN flow-tools-0.67.orig/src/flow-filter.c flow-tools-0.67/src/flow-filter.c
+--- flow-tools-0.67.orig/src/flow-filter.c 2005-01-27 02:45:08.875518256 -0500
++++ flow-tools-0.67/src/flow-filter.c 2005-01-27 02:45:23.983221536 -0500
+@@ -80,10 +80,10 @@
+ char *acl_fname, *acl_std_src_name, *acl_std_dst_name;
+ char *acl_std_nexthop_name;
+ char *acl_ext_name, *str, *strm;
+- int acl_std_src_index, acl_std_src_index2;
+- int acl_std_dst_index, acl_std_dst_index2;
+- int acl_std_nexthop_index, acl_std_nexthop_index2;
+- int acl_ext_index, acl_ext_index2;
++ int acl_std_src_index, acl_std_src_index2 = 0;
++ int acl_std_dst_index, acl_std_dst_index2 = 0;
++ int acl_std_nexthop_index, acl_std_nexthop_index2 = 0;
++ int acl_ext_index, acl_ext_index2 = 0;
+ struct acl_ip_ext_entry tmp_ext;
+ int keep_input_time;
+ int filter_input, filter_output, filter_srcport, filter_dstport;
+diff -urN flow-tools-0.67.orig/src/flow-import.c flow-tools-0.67/src/flow-import.c
+--- flow-tools-0.67.orig/src/flow-import.c 2005-01-27 02:45:08.877517952 -0500
++++ flow-tools-0.67/src/flow-import.c 2005-01-27 02:45:23.984221384 -0500
+@@ -1060,9 +1060,9 @@
+ struct ftpdu_header ftheader, ftheader2;
+ struct ftpdu ftpdu;
+ struct ftseq ftseq;
+- size_t rlen, len;
++ size_t rlen, len = 0;
+ void (*xlate)(void *in_rec, void *out_rec);
+- int ret, n, i, offset;
++ int ret = 0, n, i, offset;
+ char xl_rec[FT_IO_MAXREC], *out_rec;
+
+ bzero (&ftpdu, sizeof ftpdu);
+diff -urN flow-tools-0.67.orig/src/flow-mask.c flow-tools-0.67/src/flow-mask.c
+--- flow-tools-0.67.orig/src/flow-mask.c 2005-01-27 02:45:08.875518256 -0500
++++ flow-tools-0.67/src/flow-mask.c 2005-01-27 02:45:23.984221384 -0500
+@@ -59,7 +59,7 @@
+ struct fts3rec_offsets fo;
+ char *rec;
+ char *fname, *dname;
+- u_int32 total_flows, cap_start, cap_end;
++ u_int32 total_flows, cap_start = 0, cap_end = 0;
+ u_int32 time_start, time_end;
+ int i, keep_input_time;
+
+diff -urN flow-tools-0.67.orig/src/flow-nfilter.c flow-tools-0.67/src/flow-nfilter.c
+--- flow-tools-0.67.orig/src/flow-nfilter.c 2005-01-27 02:45:08.879517648 -0500
++++ flow-tools-0.67/src/flow-nfilter.c 2005-01-27 02:45:23.984221384 -0500
+@@ -59,7 +59,7 @@
+ struct fts3rec_offsets fo;
+ char *rec;
+ char *fname, *dname;
+- u_int32 total_flows, cap_start, cap_end;
++ u_int32 total_flows, cap_start = 0, cap_end = 0;
+ u_int32 time_start, time_end;
+ int i, keep_input_time;
+
+diff -urN flow-tools-0.67.orig/src/flow-print.c flow-tools-0.67/src/flow-print.c
+--- flow-tools-0.67.orig/src/flow-print.c 2005-01-27 02:45:08.878517800 -0500
++++ flow-tools-0.67/src/flow-print.c 2005-01-27 02:45:23.999219104 -0500
+@@ -96,7 +96,7 @@
+ {
+ struct ftio ftio;
+ struct ftprof ftp;
+- int i, format_index, set_format, ret;
++ int i, format_index = 0, set_format, ret;
+ int print_header, options, debug;
+ char cc; /* comment character */
+
+diff -urN flow-tools-0.67.orig/src/flow-send.c flow-tools-0.67/src/flow-send.c
+--- flow-tools-0.67.orig/src/flow-send.c 2005-01-27 02:45:08.875518256 -0500
++++ flow-tools-0.67/src/flow-send.c 2005-01-27 02:45:24.000218952 -0500
+@@ -63,8 +63,8 @@
+ int main(int argc, char **argv)
+ {
+ struct sockaddr_in loc_addr, rem_addr;
+- struct ip *ip_hdr;
+- struct udphdr *udp_hdr;
++ struct ip *ip_hdr = NULL;
++ struct udphdr *udp_hdr = NULL;
+ struct ftio ftio;
+ struct ftprof ftp;
+ struct ftver ftv, ftv2;
+@@ -75,8 +75,8 @@
+ char xl_rec[FT_IO_MAXREC], *out_rec;
+ u_int32 privacy_mask;
+ unsigned int v1, v2, one;
+- int i, n, ret, tx_delay, udp_sock;
+- int src_ip_spoof, hdr_len;
++ int i, n, ret = 0, tx_delay, udp_sock;
++ int src_ip_spoof, hdr_len = 0;
+ void *rec;
+
+ /* init fterr */
+diff -urN flow-tools-0.67.orig/src/flow-stat.c flow-tools-0.67/src/flow-stat.c
+--- flow-tools-0.67.orig/src/flow-stat.c 2005-01-27 02:45:08.876518104 -0500
++++ flow-tools-0.67/src/flow-stat.c 2005-01-27 02:45:24.003218496 -0500
+@@ -3572,7 +3572,7 @@
+ char fmt_buf[256], fmt_buf2[64];
+ int32 i, start, end, increment, x;
+ int s, len;
+- u_int plines;
++ u_int plines = 0;
+ u_int32 *index;
+
+ s = abs(args->sort_order);
+diff -urN flow-tools-0.67.orig/src/flow-tag.c flow-tools-0.67/src/flow-tag.c
+--- flow-tools-0.67.orig/src/flow-tag.c 2005-01-27 02:45:08.881517344 -0500
++++ flow-tools-0.67/src/flow-tag.c 2005-01-27 02:45:24.004218344 -0500
+@@ -59,7 +59,7 @@
+ struct fttag fttag;
+ struct fttag_def *ftd;
+ int i, keep_input_time;
+- u_int32 total_flows, cap_start, cap_end;
++ u_int32 total_flows, cap_start = 0, cap_end = 0;
+ u_int32 time_start, time_end;
+ char *tag_defs, *tag_active;
+ char *rec_in, *rec_out;
+diff -urN flow-tools-0.67.orig/src/flow-xlate.c flow-tools-0.67/src/flow-xlate.c
+--- flow-tools-0.67.orig/src/flow-xlate.c 2005-01-27 02:45:08.879517648 -0500
++++ flow-tools-0.67/src/flow-xlate.c 2005-01-27 02:45:24.004218344 -0500
+@@ -53,14 +53,14 @@
+ struct ftio ftio_in, ftio_out;
+ struct ftprof ftp;
+ struct ftxlate ftxlate;
+- struct ftxlate_def *ftfd;
++ struct ftxlate_def *ftfd = NULL;
+ struct ftver ftv_in, ftv_out;
+ struct ftset ftset;
+ struct fts3rec_offsets fo;
+ char *rec, out_rec[FT_IO_MAXREC];
+ char *fname, *dname;
+ unsigned int v1, v2;
+- u_int32 total_flows, cap_start, cap_end;
++ u_int32 total_flows, cap_start = 0, cap_end = 0;
+ u_int32 time_start, time_end;
+ int i, n, keep_input_time;
+ int xlate_version;
diff --git a/net-analyzer/flow-tools/files/flow-tools-0.67-fix-configure.diff b/net-analyzer/flow-tools/files/flow-tools-0.67-fix-configure.diff
new file mode 100644
index 000000000000..19cd58fb0a5b
--- /dev/null
+++ b/net-analyzer/flow-tools/files/flow-tools-0.67-fix-configure.diff
@@ -0,0 +1,150 @@
+diff -urN flow-tools-0.67.orig/acconfig.h flow-tools-0.67/acconfig.h
+--- flow-tools-0.67.orig/acconfig.h 2005-01-27 02:12:31.445092912 -0500
++++ flow-tools-0.67/acconfig.h 1969-12-31 19:00:00.000000000 -0500
+@@ -1,26 +0,0 @@
+-
+-/* Name of package. */
+-#undef PACKAGE
+-
+-/* Version of package. */
+-#undef VERSION
+-
+-/* Linux */
+-#undef _BSD_SOURCE
+-
+-/* Linux */
+-#undef HAVE_FEATURES_H
+-
+-/* BSD socket */
+-#undef HAVE_SOCK_SIN_LEN
+-
+-/* MYSQL */
+-#undef HAVE_MYSQL
+-
+-/* PGSQL */
+-#undef HAVE_PGSQL
+-
+-/* DEC */
+-#undef HAVE_LL_STRTOUL
+-
+-
+diff -urN flow-tools-0.67.orig/configure.in flow-tools-0.67/configure.in
+--- flow-tools-0.67.orig/configure.in 2005-01-27 02:12:31.444093064 -0500
++++ flow-tools-0.67/configure.in 2005-01-27 02:27:27.114930400 -0500
+@@ -17,6 +17,38 @@
+ AC_PROG_RANLIB
+ AM_PROG_LEX
+
++AC_ARG_WITH(mysql,
++ [ --with-mysql Compile in MySQL support. (default=no)],
++ [ac_with_mysql=$withval],
++ [ac_with_mysql=no])
++
++if test x$ac_with_mysql = xyes ; then
++ LIBS="-L/usr/lib/mysql"
++ AC_CHECK_LIB(mysqlclient, my_init,
++ [
++ MYSQLCFLAGS="-L/usr/lib/mysql -I/usr/include/mysql"
++ MYSQLLIB="-lmysqlclient"
++ AC_DEFINE([HAVE_MYSQL], 1, [Compile MySQL support])
++ ]
++ )
++fi
++
++AC_ARG_WITH(pgsql,
++ [ --with-pgsql Compile in PostgreSQL support (default=no)],
++ [ac_with_pgsql=$withval],
++ [ac_with_pgsql=no])
++
++if test x$ac_with_pgsql = xyes ; then
++ LIBS="-L/usr/lib/postgresql"
++ AC_CHECK_LIB(pq, PQsetdbLogin,
++ [
++ PGSQLCFLAGS="-L/usr/lib/postgresql -I/usr/include/postgresql"
++ PGSQLLIB="-lpq"
++ AC_DEFINE([HAVE_PGSQL], 1, [Compile PostgreSQL support])
++ ]
++ )
++fi
++
+ AC_SUBST(YLIB)
+ AC_SUBST(MYSQLLIB)
+ AC_SUBST(MYSQLCFLAGS)
+@@ -25,54 +57,6 @@
+ AC_SUBST(PGSQLCFLAGS)
+ AC_SUBST(PGSQLINCLUDE)
+
+-dnl extra argument: --with-mysql
+-WITH_MYSQL=
+-AC_ARG_WITH(mysql,
+-[ --with-mysql[=PATH] Compile in MySQL support. (default=no)],
+-[ if test -x "$withval"; then
+- WHERE_MYSQL=$withval
+- else
+- WHERE_MYSQL="/usr"
+- fi
+-]
+-)
+-
+-dnl extra argument: --with-pgsql
+-WITH_PGSQL=
+-AC_ARG_WITH(pgsql,
+-[ --with-pgsql[=PATH] Compile in PostgreSQL support. (default=no)],
+-[ if test -x "$withval"; then
+- WHERE_PGSQL=$withval
+- else
+- WHERE_PGSQL="/usr"
+- fi
+-]
+-)
+-
+-dnl Checks for libraries.
+-
+-if test "x$WHERE_MYSQL" != "x"; then
+- LIBS="-L$WHERE_MYSQL/lib/mysql"
+- AC_CHECK_LIB(mysqlclient, my_init,
+- [
+- MYSQLCFLAGS="-L$WHERE_MYSQL/lib/mysql -I$WHERE_MYSQL/include/mysql"
+- MYSQLLIB="-lmysqlclient"
+- AC_DEFINE(HAVE_MYSQL)
+- ]
+- )
+-fi
+-
+-if test "x$WHERE_PGSQL" != "x"; then
+- LIBS="-L$WHERE_PGSQL/lib/pgsql"
+- AC_CHECK_LIB(pq, PQsetdbLogin,
+- [
+- PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include/pgsql"
+- PGSQLLIB="-lpq"
+- AC_DEFINE(HAVE_PGSQL)
+- ]
+- )
+-fi
+-
+ AC_CHECK_LIB(y, main,YLIB="$YLIB -ly",)
+ AC_CHECK_LIB(z, zlibVersion)
+ case "X$LIBS" in
+@@ -95,11 +79,11 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>],
+ [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
+-echo yes;AC_DEFINE(HAVE_SOCK_SIN_LEN),
++echo yes;AC_DEFINE([HAVE_SOCK_SIN_LEN], 1, [Define if sockaddr_in.sin_len member exists]),
+ echo no)
+
+
+-AC_DEFINE(_BSD_SOURCE)
++AC_DEFINE([_BSD_SOURCE], 1, [Define BSD source])
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -136,7 +120,7 @@
+ }
+ ],
+ [AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_LL_STRTOUL)
++ AC_DEFINE([HAVE_LL_STRTOUL], 1, [Define if strtoul returns 64 bits])
+ ],
+ [AC_MSG_RESULT(no)],
+ )
diff --git a/net-analyzer/flow-tools/files/flow-tools-0.67-gcc34.diff b/net-analyzer/flow-tools/files/flow-tools-0.67-gcc34.diff
new file mode 100644
index 000000000000..ea3a1bb60a3e
--- /dev/null
+++ b/net-analyzer/flow-tools/files/flow-tools-0.67-gcc34.diff
@@ -0,0 +1,52 @@
+diff -urN flow-tools-0.67.orig/src/flow-cat.c flow-tools-0.67/src/flow-cat.c
+--- flow-tools-0.67.orig/src/flow-cat.c 2005-01-25 22:46:00.000000000 -0500
++++ flow-tools-0.67/src/flow-cat.c 2005-01-26 22:24:32.066024216 -0500
+@@ -551,6 +551,7 @@
+ break;
+
+ next_file:
++ ;
+
+ } /* FOREACH filename in dir */
+
+diff -urN flow-tools-0.67.orig/src/flow-dscan.c flow-tools-0.67/src/flow-dscan.c
+--- flow-tools-0.67.orig/src/flow-dscan.c 2005-01-25 22:46:00.000000000 -0500
++++ flow-tools-0.67/src/flow-dscan.c 2005-01-26 22:25:37.492077944 -0500
+@@ -560,6 +560,7 @@
+ ager(&ds, total_flows32);
+
+ skip2:
++ ;
+
+
+ } /* while rec */
+@@ -806,6 +807,7 @@
+ fterr_info("ager: reset hash run");
+
+ skip3:
++ ;
+
+ } /* ager */
+
+diff -urN flow-tools-0.67.orig/src/flow-fanout.c flow-tools-0.67/src/flow-fanout.c
+--- flow-tools-0.67.orig/src/flow-fanout.c 2005-01-25 22:46:00.000000000 -0500
++++ flow-tools-0.67/src/flow-fanout.c 2005-01-26 22:27:26.381524232 -0500
+@@ -840,6 +840,7 @@
+ } /* fte.buf_size */
+
+ skip1:
++ ;
+
+ } /* if FD_ISSET */
+
+diff -urN flow-tools-0.67.orig/src/flow-receive.c flow-tools-0.67/src/flow-receive.c
+--- flow-tools-0.67.orig/src/flow-receive.c 2005-01-25 22:46:00.000000000 -0500
++++ flow-tools-0.67/src/flow-receive.c 2005-01-26 22:26:54.761331232 -0500
+@@ -733,6 +733,7 @@
+ } /* for */
+
+ skip1:
++ ;
+
+ } /* if FD_ISSET */
+
diff --git a/net-analyzer/flow-tools/files/flow-tools-0.67-memleak.patch b/net-analyzer/flow-tools/files/flow-tools-0.67-memleak.patch
index 6f1a0c482b7a..58cb7b05fa43 100644
--- a/net-analyzer/flow-tools/files/flow-tools-0.67-memleak.patch
+++ b/net-analyzer/flow-tools/files/flow-tools-0.67-memleak.patch
@@ -1,15 +1,12 @@
---- flow-export.c~ 2004-05-20 10:12:36.000000000 +0400
-+++ flow-export.c 2004-05-20 10:49:45.000000000 +0400
-@@ -948,10 +948,12 @@ int format5(struct ftio *ftio, struct op
-
- res = PQexec(conn, query);
+diff -urN flow-tools-0.67.orig/src/flow-export.c flow-tools-0.67/src/flow-export.c
+--- flow-tools-0.67.orig/src/flow-export.c 2005-01-27 01:07:05.203972288 -0500
++++ flow-tools-0.67/src/flow-export.c 2005-01-27 01:08:26.509611952 -0500
+@@ -937,6 +937,8 @@
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
PQclear(res);
fterr_errx(1,"PQexec(): %s\n", PQerrorMessage(conn));
+ } else if (res) {
-+ PQclear(res);
++ PQclear(res);
}
}
-
- ++opt->records;
diff --git a/net-analyzer/flow-tools/files/flow-tools-0.67-nodebug.patch b/net-analyzer/flow-tools/files/flow-tools-0.67-nodebug.patch
index e3c2b9255481..f377c3710ba4 100644
--- a/net-analyzer/flow-tools/files/flow-tools-0.67-nodebug.patch
+++ b/net-analyzer/flow-tools/files/flow-tools-0.67-nodebug.patch
@@ -1,8 +1,7 @@
---- flow-export.c.orig 2003-12-04 08:55:31.000000000 +0300
-+++ flow-export.c 2004-05-13 13:00:09.000000000 +0400
-@@ -756,13 +756,14 @@ int format3(struct ftio *ftio, struct op
- strcat (query, fields);
- strcat (query, ") VALUES (");
+diff -urN flow-tools-0.67.orig/src/flow-export.c flow-tools-0.67/src/flow-export.c
+--- flow-tools-0.67.orig/src/flow-export.c 2005-01-25 22:46:00.000000000 -0500
++++ flow-tools-0.67/src/flow-export.c 2005-01-27 01:05:01.705746872 -0500
+@@ -758,10 +758,10 @@
strcat (query, values);
strcat (query, ")");
@@ -10,15 +9,12 @@
+/* if (debug)
fprintf(stderr, "field=%s\n val=%s\n query=%s\n", fields, values,
query);
+-
+*/
-
if (mysql_real_query(&mysql, query, strlen(query)) != 0)
fterr_warnx("mysql_real_query(): %s", mysql_error(&mysql));
- }
-@@ -927,13 +928,14 @@ int format5(struct ftio *ftio, struct op
- strcat (query, fields);
- strcat (query, ") VALUES (");
+@@ -929,10 +929,10 @@
strcat (query, values);
strcat (query, ")");
@@ -26,9 +22,8 @@
+/* if (debug)
fprintf(stderr, "field=%s\n val=%s\n query=%s\n", fields, values,
query);
+-
+*/
-
res = PQexec(conn, query);
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
PQclear(res);
- fterr_errx(1,"PQexec(): %s\n", PQerrorMessage(conn));