#! /bin/sh -e
## 14_flow_send_gcc4 done by Radu Spineanu <radu@debian.org>
## DP: Make sure flow-send works when compiled with gcc4


if [ $# -lt 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch -f --no-backup-if-mismatch -p1 < $0;;

       -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;

        *)
                echo >&2 \
                  "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0


@DPATCH@
diff -Naur flow-tools.old/src/flow-send.c flow-tools/src/flow-send.c
--- flow-tools.old/src/flow-send.c      2007-05-27 17:04:37.687107392 +0300
+++ flow-tools/src/flow-send.c  2007-05-27 17:04:51.943998396 +0300
@@ -76,7 +76,7 @@
   u_int32 privacy_mask;
   unsigned int v1, v2, one;
   int i, n, ret, tx_delay, udp_sock;
-  int src_ip_spoof, hdr_len;
+  int src_ip_spoof, hdr_len = 0;
   void *rec;

   /* init fterr */
