Wed Jun 21 18:20:04 2017 UTC ()
Pullup ticket #5480 - requested by sevan
net/hping3: build fix

Revisions pulled up:
- net/hping3/Makefile                                           1.8
- net/hping3/distinfo                                           1.5
- net/hping3/options.mk                                         1.2
- net/hping3/patches/patch-aa                                   1.2
- net/hping3/patches/patch-ab                                   1.3
- net/hping3/patches/patch-ac                                   1.3
- net/hping3/patches/patch-ars.c                                1.1
- net/hping3/patches/patch-ars.h                                1.1
- net/hping3/patches/patch-gethostname.c                        1.1
- net/hping3/patches/patch-libpcap__stuff.c                     1.1
- net/hping3/patches/patch-sbignum.c                            1.1
- net/hping3/patches/patch-sendip.c                             1.1

---
   Module Name:    pkgsrc
   Committed By:   jperkin
   Date:           Wed Jun 14 12:17:30 UTC 2017

   Modified Files:
           pkgsrc/net/hping3: Makefile distinfo options.mk
           pkgsrc/net/hping3/patches: patch-aa patch-ab patch-ac
   Added Files:
           pkgsrc/net/hping3/patches: patch-ars.c patch-ars.h
   patch-gethostname.c
               patch-libpcap__stuff.c patch-sbignum.c patch-sendip.c

   Log Message:
   Various patches and cleanups to fix build on Darwin and SunOS.


(bsiegert)
diff -r1.7 -r1.7.14.1 pkgsrc/net/hping3/Makefile
diff -r1.4 -r1.4.12.1 pkgsrc/net/hping3/distinfo
diff -r1.1.1.1 -r1.1.1.1.58.1 pkgsrc/net/hping3/options.mk
diff -r1.1.1.1 -r1.1.1.1.58.1 pkgsrc/net/hping3/patches/patch-aa
diff -r1.2 -r1.2.28.1 pkgsrc/net/hping3/patches/patch-ab
diff -r1.2 -r1.2.18.1 pkgsrc/net/hping3/patches/patch-ac
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-ars.c
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-ars.h
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-gethostname.c
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-libpcap__stuff.c
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-sbignum.c
diff -r0 -r1.1.2.2 pkgsrc/net/hping3/patches/patch-sendip.c

cvs diff -r1.7 -r1.7.14.1 pkgsrc/net/hping3/Makefile (expand / switch to unified diff)

--- pkgsrc/net/hping3/Makefile 2015/09/06 12:08:06 1.7
+++ pkgsrc/net/hping3/Makefile 2017/06/21 18:20:04 1.7.14.1
@@ -1,36 +1,37 @@ @@ -1,36 +1,37 @@
1# $NetBSD: Makefile,v 1.7 2015/09/06 12:08:06 wiedi Exp $ 1# $NetBSD: Makefile,v 1.7.14.1 2017/06/21 18:20:04 bsiegert Exp $
2# 2#
3 3
4DISTNAME= hping3-alpha-2 4DISTNAME= hping3-alpha-2
5PKGNAME= hping3-3a2 5PKGNAME= hping3-3a2
6PKGREVISION= 2 6PKGREVISION= 2
7CATEGORIES= net 7CATEGORIES= net
8MASTER_SITES= http://wiki.hping.org/uploadedfiles/101/ 8MASTER_SITES= http://wiki.hping.org/uploadedfiles/101/
9 9
10MAINTAINER= pettai@NetBSD.org 10MAINTAINER= pettai@NetBSD.org
11HOMEPAGE= http://wiki.hping.org/ 11HOMEPAGE= http://wiki.hping.org/
12COMMENT= Command-line oriented TCP/IP packet assembler/analyzer 12COMMENT= Command-line oriented TCP/IP packet assembler/analyzer
13LICENSE= gnu-gpl-v2 AND original-bsd 13LICENSE= gnu-gpl-v2 AND original-bsd
14 14
15SUBST_CLASSES+= paths 15SUBST_CLASSES+= paths
16SUBST_FILES.paths= ${WRKSRC}/configure 16SUBST_STAGE.paths= pre-configure
17SUBST_FILES.paths+= ${WRKSRC}/Makefile.in 17SUBST_FILES.paths= Makefile.in configure
18SUBST_STAGE.paths= post-patch 
19SUBST_SED.paths= -e 's,@PREFIX@,${PREFIX},g' 18SUBST_SED.paths= -e 's,@PREFIX@,${PREFIX},g'
20 19
21USE_TOOLS= gmake 20USE_TOOLS= gmake
22USE_PKGLOCALEDIR= yes 21USE_PKGLOCALEDIR= yes
23HAS_CONFIGURE= yes 22HAS_CONFIGURE= yes
24 23
25CONFIGURE_ENV+= INSTALL_MANPATH=${PKGMANDIR} 24CONFIGURE_ENV+= INSTALL_MANPATH=${PKGMANDIR}
26 25
 26CFLAGS.SunOS+= -Du_int64_t=uint64_t
 27
27INSTALLATION_DIRS= sbin ${PKGMANDIR}/man8 28INSTALLATION_DIRS= sbin ${PKGMANDIR}/man8
28 29
29.include "options.mk" 30.include "options.mk"
30 31
31do-install: 32do-install:
32 ${INSTALL_PROGRAM} ${WRKSRC}/hping3 ${DESTDIR}${PREFIX}/sbin/ 33 ${INSTALL_PROGRAM} ${WRKSRC}/hping3 ${DESTDIR}${PREFIX}/sbin/
33 ${INSTALL_MAN} ${WRKSRC}/docs/hping3.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/ 34 ${INSTALL_MAN} ${WRKSRC}/docs/hping3.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/
34 35
35.include "../../net/libpcap/buildlink3.mk" 36.include "../../net/libpcap/buildlink3.mk"
36.include "../../mk/bsd.pkg.mk" 37.include "../../mk/bsd.pkg.mk"

cvs diff -r1.4 -r1.4.12.1 pkgsrc/net/hping3/distinfo (expand / switch to unified diff)

--- pkgsrc/net/hping3/distinfo 2015/11/04 00:35:04 1.4
+++ pkgsrc/net/hping3/distinfo 2017/06/21 18:20:04 1.4.12.1
@@ -1,9 +1,15 @@ @@ -1,9 +1,15 @@
1$NetBSD: distinfo,v 1.4 2015/11/04 00:35:04 agc Exp $ 1$NetBSD: distinfo,v 1.4.12.1 2017/06/21 18:20:04 bsiegert Exp $
2 2
3SHA1 (hping3-alpha-2.tar.gz) = 4115f74f234730e1bd6470f4ffb0f30e3759e56d 3SHA1 (hping3-alpha-2.tar.gz) = 4115f74f234730e1bd6470f4ffb0f30e3759e56d
4RMD160 (hping3-alpha-2.tar.gz) = a1e43a2e4be64657dd7aa49a8211692d6b1673c3 4RMD160 (hping3-alpha-2.tar.gz) = a1e43a2e4be64657dd7aa49a8211692d6b1673c3
5SHA512 (hping3-alpha-2.tar.gz) = c01cb443f201e39268790e2bca744e76e0819d29ce6b23e42116fbc30b9f21d4ab7a45cce14dd78bc23b9e0408d9190ded934d0becda21296a712c074ff3d11b 5SHA512 (hping3-alpha-2.tar.gz) = c01cb443f201e39268790e2bca744e76e0819d29ce6b23e42116fbc30b9f21d4ab7a45cce14dd78bc23b9e0408d9190ded934d0becda21296a712c074ff3d11b
6Size (hping3-alpha-2.tar.gz) = 573396 bytes 6Size (hping3-alpha-2.tar.gz) = 573396 bytes
7SHA1 (patch-aa) = 25c2d447d8cc0374a27fa3de4e8bc0c1cfa2ce6c 7SHA1 (patch-aa) = 00eaef5063c9f6c70604c1aa873529936b854dd9
8SHA1 (patch-ab) = 46aa447ee7efa477a07fe46119524de8b93708f7 8SHA1 (patch-ab) = c8da38efbf33cc6fba9d32f3742479c4f1c3fb60
9SHA1 (patch-ac) = b0f96f21b8cac82a835dc8d2814eb6a39b132355 9SHA1 (patch-ac) = 885e260521b5f38d11e42871629caa9c9085c2d6
 10SHA1 (patch-ars.c) = 17c677bdce8f58386eef2d234a37159ff2e87dd7
 11SHA1 (patch-ars.h) = b06eaf399631a05acdd5d69f2241d092ed82b8c7
 12SHA1 (patch-gethostname.c) = ba1fa4747c6001efc794f0b55ab36944abdd8854
 13SHA1 (patch-libpcap__stuff.c) = 730224fa5d7e242444a112ae53959f3dfdbb35f0
 14SHA1 (patch-sbignum.c) = 0b2fb0053c7189d1fdf96007f84649ae8fb96884
 15SHA1 (patch-sendip.c) = e5cba9b45766b6906279f6351ea936d0768627cf

cvs diff -r1.1.1.1 -r1.1.1.1.58.1 pkgsrc/net/hping3/options.mk (expand / switch to unified diff)

--- pkgsrc/net/hping3/options.mk 2010/03/14 18:37:58 1.1.1.1
+++ pkgsrc/net/hping3/options.mk 2017/06/21 18:20:04 1.1.1.1.58.1
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: options.mk,v 1.1.1.1 2010/03/14 18:37:58 pettai Exp $ 1# $NetBSD: options.mk,v 1.1.1.1.58.1 2017/06/21 18:20:04 bsiegert Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.hping3 3PKG_OPTIONS_VAR= PKG_OPTIONS.hping3
4PKG_SUPPORTED_OPTIONS= tcl 4PKG_SUPPORTED_OPTIONS= tcl
5PKG_SUGGESTED_OPTIONS= 5PKG_SUGGESTED_OPTIONS=
6 6
7.include "../../mk/bsd.options.mk" 7.include "../../mk/bsd.options.mk"
8 8
9### 9###
10### TCL scripting support 10### TCL scripting support
11### 11###
12.if !empty(PKG_OPTIONS:Mtcl) 12.if !empty(PKG_OPTIONS:Mtcl)
13.include "../../lang/tcl/buildlink3.mk" 13.include "../../lang/tcl/buildlink3.mk"
14.else 14.else
15CONFIGURE_ARGS+= --no-tcl 15CONFIGURE_ARGS+= --no-tcl
 16CONFIGURE_ENV+= TCLSH=/nonexistent
16.endif 17.endif

cvs diff -r1.1.1.1 -r1.1.1.1.58.1 pkgsrc/net/hping3/patches/patch-aa (expand / switch to unified diff)

--- pkgsrc/net/hping3/patches/patch-aa 2010/03/14 18:37:58 1.1.1.1
+++ pkgsrc/net/hping3/patches/patch-aa 2017/06/21 18:20:04 1.1.1.1.58.1
@@ -1,14 +1,16 @@ @@ -1,14 +1,16 @@
1$NetBSD: patch-aa,v 1.1.1.1 2010/03/14 18:37:58 pettai Exp $ 1$NetBSD: patch-aa,v 1.1.1.1.58.1 2017/06/21 18:20:04 bsiegert Exp $
 2
 3Use pkgsrc paths.
2 4
3--- configure.orig 2004-06-04 08:39:10.000000000 +0200 5--- configure.orig 2004-06-04 08:39:10.000000000 +0200
4+++ configure 2010-01-26 23:07:03.000000000 +0100 6+++ configure 2010-01-26 23:07:03.000000000 +0100
5@@ -20,7 +20,7 @@ 7@@ -20,7 +20,7 @@
6  8
7 INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:` 9 INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:`
8 if [ "$INSTALL_MANPATH" = "" ]; then 10 if [ "$INSTALL_MANPATH" = "" ]; then
9- INSTALL_MANPATH="/usr/local/man" 11- INSTALL_MANPATH="/usr/local/man"
10+ INSTALL_MANPATH="@PREFIX@/man" 12+ INSTALL_MANPATH="@PREFIX@/man"
11 fi 13 fi
12 BYTEORDER=`./byteorder -m` 14 BYTEORDER=`./byteorder -m`
13  15
14@@ -61,7 +61,7 @@ 16@@ -61,7 +61,7 @@

cvs diff -r1.2 -r1.2.28.1 pkgsrc/net/hping3/patches/patch-ab (expand / switch to unified diff)

--- pkgsrc/net/hping3/patches/patch-ab 2013/10/20 18:00:57 1.2
+++ pkgsrc/net/hping3/patches/patch-ab 2017/06/21 18:20:04 1.2.28.1
@@ -1,18 +1,29 @@ @@ -1,18 +1,29 @@
1$NetBSD: patch-ab,v 1.2 2013/10/20 18:00:57 joerg Exp $ 1$NetBSD: patch-ab,v 1.2.28.1 2017/06/21 18:20:04 bsiegert Exp $
2 2
3--- Makefile.in.orig 2004-04-10 01:38:56.000000000 +0200 3Use pkgsrc flags/paths.
4+++ Makefile.in 2010-01-26 23:35:22.000000000 +0100 4
5@@ -50,14 +50,14 @@ 5--- Makefile.in.orig 2004-04-09 23:38:56.000000000 +0000
 6+++ Makefile.in
 7@@ -9,7 +9,7 @@
 8 CC= gcc
 9 AR=/usr/bin/ar
 10 RANLIB=/usr/bin/ranlib
 11-CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
 12+CCOPT= $(CFLAGS) @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
 13 DEBUG= -g
 14 #uncomment the following if you need libpcap based build under linux
 15 #(not raccomanded)
 16@@ -50,14 +50,14 @@ libars.a: $(ARSOBJ)
6 $(RANLIB) $@ 17 $(RANLIB) $@
7  18
8 hping3: byteorder.h $(OBJ) 19 hping3: byteorder.h $(OBJ)
9- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ 20- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
10+ $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L@PREFIX@/lib ${COMPILER_RPATH_FLAG}@PREFIX@/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ 21+ $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L@PREFIX@/lib ${COMPILER_RPATH_FLAG}@PREFIX@/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
11 @echo 22 @echo
12 ./hping3 -v 23 ./hping3 -v
13 @echo "use \`make strip' to strip hping3 binary" 24 @echo "use \`make strip' to strip hping3 binary"
14 @echo "use \`make install' to install hping3" 25 @echo "use \`make install' to install hping3"
15  26
16 hping3-static: byteorder.h $(OBJ) 27 hping3-static: byteorder.h $(OBJ)
17- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl 28- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
18+ $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L@PREFIX@/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl 29+ $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L@PREFIX@/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl

cvs diff -r1.2 -r1.2.18.1 pkgsrc/net/hping3/patches/patch-ac (expand / switch to unified diff)

--- pkgsrc/net/hping3/patches/patch-ac 2015/02/23 18:27:09 1.2
+++ pkgsrc/net/hping3/patches/patch-ac 2017/06/21 18:20:04 1.2.18.1
@@ -1,33 +1,43 @@ @@ -1,33 +1,43 @@
1$NetBSD: patch-ac,v 1.2 2015/02/23 18:27:09 joerg Exp $ 1$NetBSD: patch-ac,v 1.2.18.1 2017/06/21 18:20:04 bsiegert Exp $
 2
 3Use system macros if available.
2 4
3--- bytesex.h.orig 2003-08-31 17:23:48.000000000 +0000 5--- bytesex.h.orig 2003-08-31 17:23:48.000000000 +0000
4+++ bytesex.h 6+++ bytesex.h
5@@ -7,19 +7,18 @@ 7@@ -7,11 +7,25 @@
6 #ifndef ARS_BYTESEX_H 8 #ifndef ARS_BYTESEX_H
7 #define ARS_BYTESEX_H 9 #define ARS_BYTESEX_H
8  10
9-#if defined(__i386__) \ 11-#if defined(__i386__) \
10- || defined(__alpha__) \ 12+#ifdef __NetBSD__
11- || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) 
12+#include <sys/endian.h> 13+#include <sys/endian.h>
 14+#endif
13+ 15+
14+#if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) 16+#if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN - 0)
 17+#define BYTE_ORDER_LITTLE_ENDIAN
 18+#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == _LITTLE_ENDIAN - 0)
15+#define BYTE_ORDER_LITTLE_ENDIAN 19+#define BYTE_ORDER_LITTLE_ENDIAN
16+#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == _LITTLE_ENDIAN) 20+#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
 21+#define BYTE_ORDER_LITTLE_ENDIAN
 22+#elif defined(__i386__) || defined(__LITTLE_ENDIAN__) \
 23 || defined(__alpha__) \
 24 || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
17 #define BYTE_ORDER_LITTLE_ENDIAN 25 #define BYTE_ORDER_LITTLE_ENDIAN
18-#elif defined(__mc68000__) \ 26-#elif defined(__mc68000__) \
19- || defined (__sparc__) \ 27+#elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN - 0)
20- || defined (__sparc) \ 28+#define BYTE_ORDER_BIG_ENDIAN
21- || defined (__PPC__) \ 29+#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == _BIG_ENDIAN - 0)
22- || defined (__BIG_ENDIAN__) \ 
23- || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) 
24+#elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) 
25+#define BYTE_ORDER_BIG_ENDIAN 30+#define BYTE_ORDER_BIG_ENDIAN
26+#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == _BIG_ENDIAN) 31+#elif defined(__mc68000__) \
 32 || defined (__sparc__) \
 33 || defined (__sparc) \
 34 || defined (__PPC__) \
 35@@ -19,7 +33,7 @@
 36 || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))
27 #define BYTE_ORDER_BIG_ENDIAN 37 #define BYTE_ORDER_BIG_ENDIAN
28 #else 38 #else
29-# error can not find the byte order for this architecture, fix bytesex.h 39-# error can not find the byte order for this architecture, fix bytesex.h
30+#error can not find the byte order for this architecture, fix bytesex.h 40+#error can not find the byte order for this architecture, fix bytesex.h
31 #endif 41 #endif
32  42
33 #endif /* ARS_BYTESEX_H */ 43 #endif /* ARS_BYTESEX_H */

File Added: pkgsrc/net/hping3/patches/patch-ars.c
$NetBSD: patch-ars.c,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

Darwin compatibility, from Homebrew.

--- ars.c.orig	2004-04-14 12:30:18.000000000 +0000
+++ ars.c
@@ -914,7 +914,7 @@ int ars_bsd_fix(struct ars_packet *pkt,
 		return -ARS_INVALID;
 	}
 	ip = (struct ars_iphdr*) packet;
-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
+#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
 	ip->tot_len = ntohs(ip->tot_len);
 	ip->frag_off = ntohs(ip->frag_off);
 #endif

File Added: pkgsrc/net/hping3/patches/patch-ars.h
$NetBSD: patch-ars.h,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

SunOS requires alloca.h

--- ars.h.orig	2004-06-04 07:22:38.000000000 +0000
+++ ars.h
@@ -11,6 +11,9 @@
 #define _BSD_SOCKLEN_T_ int
 #endif
 
+#ifdef __sun
+#include <alloca.h>
+#endif
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <string.h>

File Added: pkgsrc/net/hping3/patches/patch-gethostname.c
$NetBSD: patch-gethostname.c,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

Delete conflicting strlcpy definition.

--- gethostname.c.orig	2003-09-01 00:22:06.000000000 +0000
+++ gethostname.c
@@ -18,8 +18,6 @@
 #include <arpa/inet.h>
 #include <string.h>
 
-size_t strlcpy(char *dst, const char *src, size_t siz);
-
 char *get_hostname(char* addr)
 {
 	static char answer[1024];

File Added: pkgsrc/net/hping3/patches/patch-libpcap__stuff.c
$NetBSD: patch-libpcap__stuff.c,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

Fix include ordering to avoid redefined bpf_* symbols.

--- libpcap_stuff.c.orig	2004-04-09 23:38:56.000000000 +0000
+++ libpcap_stuff.c
@@ -16,8 +16,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
-#include <pcap.h>
 #include <net/bpf.h>
+#include <pcap.h>
 
 #include "globals.h"
 

File Added: pkgsrc/net/hping3/patches/patch-sbignum.c
$NetBSD: patch-sbignum.c,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

SunOS requires alloca.h

--- sbignum.c.orig	2003-10-02 08:21:42.000000000 +0000
+++ sbignum.c
@@ -40,6 +40,9 @@
  * 12 Sep 2003: Fixed a memory leak in mpz_tostr().
  */
 
+#ifdef __sun
+#include <alloca.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>

File Added: pkgsrc/net/hping3/patches/patch-sendip.c
$NetBSD: patch-sendip.c,v 1.1.2.2 2017/06/21 18:20:04 bsiegert Exp $

Darwin compatibility, from Homebrew.

--- sendip.c.orig	2004-04-09 23:38:56.000000000 +0000
+++ sendip.c
@@ -48,7 +48,7 @@ void send_ip (char* src, char *dst, char
 	ip->ihl		= (IPHDR_SIZE + optlen + 3) >> 2;
 	ip->tos		= ip_tos;
 
-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
+#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
 /* FreeBSD */
 /* NetBSD */
 	ip->tot_len	= packetsize;
@@ -73,7 +73,7 @@ void send_ip (char* src, char *dst, char
 			htons((unsigned short) src_id);
 	}
 
-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI
+#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI
 /* FreeBSD */
 /* NetBSD */
 	ip->frag_off	|= more_fragments;