Here's an update to tcpreplay that I've had sitting in my tree for a while. I haven't tested real world use but the self tests run (I only tried them with one interface though). Builds OK with -fno-common.
Index: Makefile =================================================================== RCS file: /cvs/ports/net/tcpreplay/Makefile,v retrieving revision 1.39 diff -u -p -r1.39 Makefile --- Makefile 12 Jul 2019 20:48:49 -0000 1.39 +++ Makefile 30 Jan 2021 09:19:27 -0000 @@ -2,24 +2,28 @@ COMMENT= resend network traffic saved by tcpdump -DISTNAME= tcpreplay-4.0.5 +V= 4.3.3 +DISTNAME= tcpreplay-$V CATEGORIES= net -REVISION= 2 -HOMEPAGE= http://tcpreplay.appneta.com/ +HOMEPAGE= https://tcpreplay.appneta.com/ MAINTAINER= Nigel Taylor <[email protected]> # GPLv3 PERMIT_PACKAGE= Yes -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tcpreplay/} - WANTLIB= c dnet>=1 +MASTER_SITES= https://github.com/appneta/tcpreplay/releases/download/v$V/ + CONFIGURE_STYLE= gnu LIB_DEPENDS= net/libdnet -BUILD_DEPENDS= devel/autogen + +do-test: + @echo; echo "To run tests: cd ${WRKSRC}/test," + @echo "edit Makefile and config to set interface, run gmake as root." + @echo .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/net/tcpreplay/distinfo,v retrieving revision 1.9 diff -u -p -r1.9 distinfo --- distinfo 16 Oct 2014 13:00:56 -0000 1.9 +++ distinfo 30 Jan 2021 09:19:27 -0000 @@ -1,2 +1,2 @@ -SHA256 (tcpreplay-4.0.5.tar.gz) = Y3mMityeW+eUZ+I1k4OM4OYXslk4z84xFv7aJjA0TYA= -SIZE (tcpreplay-4.0.5.tar.gz) = 2059744 +SHA256 (tcpreplay-4.3.3.tar.gz) = 7SQCyqlDT/XHSy57MReMc+fHxcTqHh0OLjmn3EaVj94= +SIZE (tcpreplay-4.3.3.tar.gz) = 3727820 Index: patches/patch-configure =================================================================== RCS file: patches/patch-configure diff -N patches/patch-configure --- patches/patch-configure 16 Oct 2014 13:43:48 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-configure,v 1.4 2014/10/16 13:43:48 nigel Exp $ ---- configure.orig Fri Sep 5 17:16:38 2014 -+++ configure Fri Oct 10 15:21:36 2014 -@@ -18765,7 +18765,7 @@ else - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ --[ -+ - #include <stdio.h> - #include <stdlib.h> - #include <sys/types.h> -@@ -18793,7 +18793,7 @@ main(int argc, char *argv[]) { - - /* else suck, no good */ - exit(-1); --}] -+} - _ACEOF - if ac_fn_c_try_run "$LINENO"; then : - Index: patches/patch-src_defines_h_in =================================================================== RCS file: patches/patch-src_defines_h_in diff -N patches/patch-src_defines_h_in --- patches/patch-src_defines_h_in 6 Jul 2016 10:29:51 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-src_defines_h_in,v 1.1 2016/07/06 10:29:51 jasper Exp $ - -CVE-2016-6160 -https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829350 - ---- src/defines.h.in.orig Fri May 9 19:28:13 2014 -+++ src/defines.h.in Wed Jul 6 10:54:28 2016 -@@ -145,7 +145,7 @@ typedef struct tcpr_speed_s { - #define DEFAULT_MTU 1500 /* Max Transmission Unit of standard ethernet - * don't forget *frames* are MTU + L2 header! */ - --#define MAXPACKET 65535 /* was 16436 linux loopback, but maybe something is bigger then -+#define MAXPACKET 65549 /* was 16436 linux loopback, but maybe something is bigger then - linux loopback */ - - #define MAX_SNAPLEN 65535 /* tell libpcap to capture the entire packet */ Index: patches/patch-src_tcprewrite_c =================================================================== RCS file: patches/patch-src_tcprewrite_c diff -N patches/patch-src_tcprewrite_c --- patches/patch-src_tcprewrite_c 6 Jul 2016 10:29:51 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-src_tcprewrite_c,v 1.1 2016/07/06 10:29:51 jasper Exp $ - -CVE-2016-6160 -https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829350 - ---- src/tcprewrite.c.orig Fri May 9 19:28:13 2014 -+++ src/tcprewrite.c Wed Jul 6 10:54:06 2016 -@@ -250,6 +250,8 @@ rewrite_packets(tcpedit_t *tcpedit, pcap_t *pin, pcap_ - packetnum++; - dbgx(2, "packet " COUNTER_SPEC " caplen %d", packetnum, pkthdr.caplen); - -+ if (pkthdr.caplen > MAXPACKET) -+ errx(-1, "Frame too big, caplen %d exceeds %d", pkthdr.caplen, MAXPACKET); - /* - * copy over the packet so we can pad it out if necessary and - * because pcap_next() returns a const ptr
