File hping-build-fix.patch of Package hping

--- ars.c.orig
+++ ars.c
@@ -481,8 +481,8 @@ u_int16_t ars_multi_cksum(struct mc_cont
 		sum = (sum >> 16) + (sum & 0xffff);
 		sum += (sum >> 16);
 		return (u_int16_t) ~sum;
-	} else {
-		assert("else reached in ars_multi_cksum()" == "");
+//	} else {
+//		assert("else reached in ars_multi_cksum()" == "");
 	}
 	return 0; /* unreached, here to prevent warnings */
 }
--- scan.c.orig
+++ scan.c
@@ -456,7 +456,7 @@ static void receiver(struct portinfo *pi
 				continue;
 			/* time to copy headers in a safe place */
 			p = packet+linkhdr_size+iphdrlen;
-			memcpy(&icmp, p, sizeof(subtcp));
+			memcpy(&icmp, p, sizeof(icmp));
 			p += sizeof(icmp);
 			memcpy(&subip, p, sizeof(ip));
 			p += sizeof(ip);
--- bytesex.h.orig
+++ bytesex.h
@@ -7,20 +7,10 @@
 #ifndef ARS_BYTESEX_H
 #define ARS_BYTESEX_H
 
-#if 	defined(__i386__) \
-	|| defined(__alpha__) \
-    || defined(__x86_64__) \
-	|| (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
-#define BYTE_ORDER_LITTLE_ENDIAN
-#elif 	defined(__mc68000__) \
-	|| defined (__sparc__) \
-	|| defined (__sparc) \
-	|| defined (__PPC__) \
-	|| defined (__BIG_ENDIAN__) \
-	|| (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))
+#if defined(WORDS_BIGENDIAN)
 #define BYTE_ORDER_BIG_ENDIAN
-#else
-# error can not find the byte order for this architecture, fix bytesex.h
+#else 
+#define BYTE_ORDER_LITTLE_ENDIAN
 #endif
 
 #endif /* ARS_BYTESEX_H */
--- /dev/null
+++ configure.ac
@@ -0,0 +1,39 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.68])
+AC_INIT([hping3], [20051105], [http://www.hping.org/])
+AC_CONFIG_SRCDIR([statistics.c])
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([foreign])
+# Checks for programs.
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
+AC_C_BIGENDIAN
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_RANLIB
+
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ALLOCA
+AC_FUNC_FORK
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([alarm floor gethostbyaddr gethostbyname gettimeofday inet_ntoa memmove memset select socket strcasecmp strchr strdup strerror strstr strtol strtoul])
+AC_SEARCH_LIBS(pcap_version, pcap)
+AC_SEARCH_LIBS(dlopen, dl)
+AC_SEARCH_LIBS(Tcl_EvalObjEx, tcl tcl8.6 tcl8.5 tcl8.4 tcl8.3 tcl8.2 tcl8.1 tcl8.0, [AC_DEFINE([USE_TCL], [1], [TCL support is enabled])])
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
--- configure
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/bin/sh
-
-show_help()
-{
-	echo configure help:
-	echo "--help               show this help"
-	echo "--no-tcl             disable TCL scripting support"
-	echo "                     even if uid != euid"
-}
-
-if [ "$1" = "--help" ]; then
-	show_help
-	exit 0
-fi
-
-CC=${CC:=cc}
-
-echo build byteorder.c...
-$CC byteorder.c -o byteorder || exit 1
-
-INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:`
-if [ "$INSTALL_MANPATH" = "" ]; then
-	INSTALL_MANPATH="/usr/local/man"
-fi
-BYTEORDER=`./byteorder -m`
-
-echo create byteorder.h...
-cat > byteorder.h <<EOF
-#ifndef __BYTEORDER_H
-#define __BYTEORDER_H
-
-EOF
-echo \#ifndef $BYTEORDER >> byteorder.h
-echo \#define $BYTEORDER >> byteorder.h
-echo \#endif /\* $BYTEORDER \*/ >> byteorder.h
-cat >> byteorder.h <<EOF
-
-#endif /* __BYTEORDER_H */
-EOF
-
-CONFIGOSTYPE=`uname -s | tr [a-z] [A-Z]`
-if [ ! "$CONFIGOSTYPE" ]; then
-	CONFIGOSTYPE=UNKNOWN
-fi
-
-# for BSD/OS use the historical name as it doesn't include '/'
-if [  $CONFIGOSTYPE = "BSD/OS" ]; then
-	CONFIGOSTYPE=BSDI
-fi
-
-case $CONFIGOSTYPE in
-  SUNOS)
-    SOLARISLIB="-lsocket -lresolv -lnsl"
-    BUG='/* #define STUPID_SOLARIS_CHECKSUM_BUG */'
-    case `uname -r` in
-      2.0*|5.0*|2.1*|5.1*|2.2*|5.2*|2.3*|5.3*|2.4*|5.4*|5.5.1)
-               BUG='#define STUPID_SOLARIS_CHECKSUM_BUG' ;;
-    esac
-esac
-
-#
-# TCL detection
-#
-for TCLPATH_TRY in "/usr/bin/" "/usr/local/bin/" "/bin/"
-do
-	for TCLVER_TRY in "8.4" "8.3" "8.2" "8.1" "8.0"
-	do
-		if [ -z $TCLSH ]
-		then
-			TCLSH_TRY=${TCLPATH_TRY}tclsh${TCLVER_TRY}
-			if [ -f $TCLSH_TRY ]
-			then
-				TCLSH=$TCLSH_TRY
-				echo "===> Found Tclsh in: $TCLSH"
-			fi
-		fi
-	done
-done
-if [ -f $TCLSH ]
-then
-	TCL_VER=`echo puts \\$tcl_version | $TCLSH -`
-	USE_TCL='-DUSE_TCL'
-	TCL_LIB="-ltcl${TCL_VER}"
-	if [ -e /usr/include/tcl${TCL_VER} ]
-	then
-		TCL_INC="-I/usr/include/tcl${TCL_VER}"
-	elif [ -e /usr/include/tcl.h ]
-	then
-		TCL_INC=""
-	elif [ -e /usr/local/include/tcl${TCL_VER} ]
-	then
-		TCL_INC="-I/usr/local/include/tcl${TCL_VER}"
-	else
-		USE_TCL=""
-		TCL_LIB=""
-		echo "==> WARNING: no Tcl header files found!"
-	fi
-fi
-if [ -n $USE_TCL ]
-then
-	LIBPOSTFIX=`ls -1 /usr/local/lib/ /usr/lib/ /usr/lib64/ | grep 'libtcl[0-9]' | grep so | sed -e 's/\.so.*//g' -e 's/libtcl//g' | sort -r | head -1`
-	TCL_LIB="-ltcl${LIBPOSTFIX} -lm -lpthread"
-fi
-
-#
-# configurable stuff
-#
-PCAP="PCAP=-lpcap"
-PCAP_INCLUDE=""
-
-for ARG in $*; do
-	case "$ARG" in
-		*"--no-tcl")
-			USE_TCL=""
-			TCL_VER=""
-			TCL_INC=""
-			TCL_LIB=""
-			;;
-	esac
-done
-
-echo --------------------------------------
-echo system type: $CONFIGOSTYPE
-echo
-echo "LIBPCAP      : $PCAP"
-echo "PCAP_INCLUDE : $PCAP_INCLUDE"
-echo "MANPATH      : $INSTALL_MANPATH"
-echo "USE_TCL      : $USE_TCL"
-echo "TCL_VER      : $TCL_VER"
-echo "TCL_INC      : $TCL_INC"
-echo "LIBTCL       : $TCL_LIB"
-echo "TCLSH        : $TCLSH"
-echo
-echo "(to modify try configure --help)"
-echo --------------------------------------
-
-echo creating Makefile...
-sed	-e "s^@PCAP@^$PCAP^g" \
-	-e "s^@PCAP_INCLUDE@^$PCAP_INCLUDE^g" \
-	-e "s^@MANPATH@^$INSTALL_MANPATH^g" \
-	-e "s^@SOLARISLIB@^$SOLARISLIB^g" \
-	-e "s^@USE_TCL@^$USE_TCL^g" \
-	-e "s^@TCL_INC@^$TCL_INC^g" \
-	-e "s^@TCL_VER@^$TCL_VER^g" \
-	-e "s^@TCL_LIB@^$TCL_LIB^g" \
-	<Makefile.in > Makefile
-
-#
-#
-#
-
-cat > systype.h <<EOF
-#ifndef __SYSTYPE_H
-#define __SYSTYPE_H
-
-EOF
-echo \#define OSTYPE_${CONFIGOSTYPE} >> systype.h
-cat >> systype.h <<EOF
-
-#endif /* SYSTYPE_H */
-EOF
-
-echo creating dependences...
-$CC -MM *.c > .depend
-
-echo now you can try \`make\'
--- /dev/null
+++ Makefile.am
@@ -0,0 +1,30 @@
+
+AM_CFLAGS = -include config.h -Wall -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Wformat=2
+
+sbin_PROGRAMS = hping3
+
+noinst_LIBRARIES = libars.a
+
+libars_a_SOURCES = ars.c apd.c split.c rapd.c
+
+hping3_SOURCES = main.c getifname.c getlhs.c \
+parseoptions.c datafiller.c \
+datahandler.c gethostname.c \
+binding.c getusec.c opensockraw.c \
+logicmp.c waitpacket.c resolve.c \
+sendip.c sendicmp.c sendudp.c \
+sendtcp.c cksum.c statistics.c \
+usage.c version.c antigetopt.c \
+sockopt.c listen.c \
+sendhcmp.c memstr.c rtt.c \
+relid.c sendip_handler.c \
+libpcap_stuff.c memlockall.c memunlockall.c \
+memlock.c memunlock.c ip_opt_build.c \
+display_ipopt.c sendrawip.c signal.c send.c \
+strlcpy.c arsglue.c random.c scan.c \
+hstring.c script.c interface.c \
+adbuf.c hex.c apdutils.c sbignum.c \
+sbignum-tables.c
+
+hping3_LDADD = libars.a
+dist_man8_MANS = docs/hping3.8
--- getifname.c.orig
+++ getifname.c
@@ -39,7 +39,7 @@
 #include <net/if_dl.h>
 #endif
 
-#if (defined OSTYPE_LINUX) || (defined __sun__)
+#if (defined __linux__) || (defined __sun__)
 int get_if_name(void)
 {
 	int fd;
--- interface.c.orig
+++ interface.c
@@ -61,7 +61,7 @@
  * the interfaces.
  *
  * On error -1 is returned, and errno set. */
-#if (defined OSTYPE_LINUX) || (defined __sun__)
+#if (defined __linux__) || (defined __sun__)
 int hping_get_interfaces(struct hpingif *hif, int ilen)
 {
 	int fd, found = 0, i;
--- libpcap_stuff.c.orig
+++ libpcap_stuff.c
@@ -35,7 +35,7 @@ int open_pcap()
 		printf("[open_pcap] pcap_open_live: %s\n", errbuf);
 		return -1;
 	}
-#if (!defined OSTYPE_LINUX) && (!defined __sun__)
+#if (!defined __linux__) && (!defined __sun__)
 	/* Return the packets to userspace as fast as possible */
 	if (ioctl(pcap_fileno(pcapfp), BIOCIMMEDIATE, &on) == -1)
 		perror("[open_pcap] ioctl(... BIOCIMMEDIATE ...)");
--- script.c.orig
+++ script.c
@@ -67,7 +67,7 @@ static void HpingRecvCloseHandler(struct
 static struct recv_handler *HpingRecvGetHandler(struct recv_handler *ra, int len, char *ifname, Tcl_Interp *interp)
 {
 	int i;
-	#if (!defined OSTYPE_LINUX) && (!defined __sun__)
+	#if (!defined __linux__) && (!defined __sun__)
 	int on = 1;
 	#endif
 
@@ -88,7 +88,7 @@ static struct recv_handler *HpingRecvGet
 	ra[i].rh_pcapfp = pcap_open_live(ifname, 99999, 0, 1, ra[i].rh_pcap_errbuf);
 	if (ra[i].rh_pcapfp == NULL)
 		return NULL;
-	#if (!defined OSTYPE_LINUX) && (!defined __sun__)
+	#if (!defined __linux__) && (!defined __sun__)
 	/* Return the packets to userspace as fast as possible */
 	if (ioctl(pcap_fileno(ra[i].rh_pcapfp), BIOCIMMEDIATE, &on) == -1) {
 		/* XXX non-critical error */