From a3bb356aa453d23a160f1fb00a56c73931f04a02 Mon Sep 17 00:00:00 2001 From: gdt Date: Mon, 15 Mar 2021 16:44:32 +0000 Subject: net/iperf2: Add version 2.0.13 As discussed on pksrc-users@, this is the currently-maintained, more or less, continuation fork of an older fork (in net/iperf) that is not maintained. It's net/iperf2 to avoid misleading users looking for "iperf" into thinking that it is the normal approach. Relative to net/iperf, this update drops a patch deleting upstream's ad hoc definition of bool, because it fails to build on NetBSD with that modification. Iperf is a tool for measuring TCP and UDP bandwidth performance. It reports bandwidth, delay jitter, datagram loss. It also supports IPv6 and IP Multicast. This version is a continuation fork of an older continuation fork of the original code. The original code and the first continuation fork are no longer maintained. See also net/iperf3. --- net/iperf2/DESCR | 7 ++++++ net/iperf2/Makefile | 26 ++++++++++++++++++++++ net/iperf2/PLIST | 6 +++++ net/iperf2/distinfo | 8 +++++++ net/iperf2/patches/patch-src_Listener.cpp | 34 +++++++++++++++++++++++++++++ net/iperf2/patches/patch-src_PerfSocket.cpp | 20 +++++++++++++++++ 6 files changed, 101 insertions(+) create mode 100644 net/iperf2/DESCR create mode 100644 net/iperf2/Makefile create mode 100644 net/iperf2/PLIST create mode 100644 net/iperf2/distinfo create mode 100644 net/iperf2/patches/patch-src_Listener.cpp create mode 100644 net/iperf2/patches/patch-src_PerfSocket.cpp diff --git a/net/iperf2/DESCR b/net/iperf2/DESCR new file mode 100644 index 00000000000..eb2902b655f --- /dev/null +++ b/net/iperf2/DESCR @@ -0,0 +1,7 @@ +Iperf is a tool for measuring TCP and UDP bandwidth performance. +It reports bandwidth, delay jitter, datagram loss. It also supports +IPv6 and IP Multicast. + +This version is a continuation fork of an older continuation fork of +the original code. The original code and the first continuation fork +are no longer maintained. See also net/iperf3. diff --git a/net/iperf2/Makefile b/net/iperf2/Makefile new file mode 100644 index 00000000000..c1122d6145a --- /dev/null +++ b/net/iperf2/Makefile @@ -0,0 +1,26 @@ +# $NetBSD: Makefile,v 1.1 2021/03/15 16:44:32 gdt Exp $ + +DISTNAME= iperf-2.0.13 +CATEGORIES= net benchmarks +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=iperf2/} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://sourceforge.net/projects/iperf2/ +COMMENT= TCP and UDP bandwidth performance measurement tool +LICENSE= modified-bsd + +.include "../../mk/bsd.prefs.mk" + +USE_LANGUAGES= c c++ +GNU_CONFIGURE= yes + +LIBS.SunOS+= -lrt + +INSTALLATION_DIRS+= share/doc/${PKGBASE} + +post-install: + ${INSTALL_DATA} ${WRKSRC}/doc/*.gif ${WRKSRC}/doc/*.html \ + ${DESTDIR}${PREFIX}/share/doc/${PKGBASE} + +.include "../../mk/pthread.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/net/iperf2/PLIST b/net/iperf2/PLIST new file mode 100644 index 00000000000..91421c0bfaf --- /dev/null +++ b/net/iperf2/PLIST @@ -0,0 +1,6 @@ +@comment $NetBSD: PLIST,v 1.1 2021/03/15 16:44:32 gdt Exp $ +bin/iperf +man/man1/iperf.1 +share/doc/iperf/dast.gif +share/doc/iperf/index.html +share/doc/iperf/ui_license.html diff --git a/net/iperf2/distinfo b/net/iperf2/distinfo new file mode 100644 index 00000000000..6df2ad87167 --- /dev/null +++ b/net/iperf2/distinfo @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1 2021/03/15 16:44:32 gdt Exp $ + +SHA1 (iperf-2.0.13.tar.gz) = 0c7625c61087b9e6866421abb8bb533658b40a8d +RMD160 (iperf-2.0.13.tar.gz) = 199ccc03cabb48e825b948688bbc1867369cf9ef +SHA512 (iperf-2.0.13.tar.gz) = 40fcfb8f4d27887f53a743ac07396511fb2a7ac59f4b300fe36896bd0241e191945fa253705990711772ee776d5e4227ed62760fc92abebdfebcedd11c27c0ea +Size (iperf-2.0.13.tar.gz) = 326148 bytes +SHA1 (patch-src_Listener.cpp) = cb253ec55576675d5bf50a29e6b4ebe6a1391ac7 +SHA1 (patch-src_PerfSocket.cpp) = 1b1ef70ab3938078876277a37fc1a0d7c26deb49 diff --git a/net/iperf2/patches/patch-src_Listener.cpp b/net/iperf2/patches/patch-src_Listener.cpp new file mode 100644 index 00000000000..96bcc4e2dea --- /dev/null +++ b/net/iperf2/patches/patch-src_Listener.cpp @@ -0,0 +1,34 @@ +$NetBSD: patch-src_Listener.cpp,v 1.1 2021/03/15 16:44:32 gdt Exp $ + +Fix bug where the standards-specificed IPV6_JOIN_GROUP is not used. +See https://tools.ietf.org/html/rfc3493 on page 20. +See https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10_16 + +Fix bug where setsockopt was used with int when it is defined to use +unsigned char. This should avoid bugs on BE machines. + +Not yet reported upstream. + +--- src/Listener.cpp.orig 2019-01-22 20:31:17.000000000 +0000 ++++ src/Listener.cpp +@@ -462,6 +462,9 @@ void Listener::McastJoin( ) { + + } else { + #ifdef HAVE_IPV6_MULTICAST ++#if !defined(IPV6_ADD_MEMBERSHIP) && defined(IPV6_JOIN_GROUP) ++#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP ++#endif + struct ipv6_mreq mreq; + + memcpy( &mreq.ipv6mr_multiaddr, SockAddr_get_in6_addr( &mSettings->local ), +@@ -759,8 +762,9 @@ int Listener::L2_setup (void) { + void Listener::McastSetTTL( int val ) { + #ifdef HAVE_MULTICAST + if ( !SockAddr_isIPv6( &mSettings->local ) ) { ++ u_char uval = val; + int rc = setsockopt( mSettings->mSock, IPPROTO_IP, IP_MULTICAST_TTL, +- (char*) &val, sizeof(val)); ++ (char*) &uval, sizeof(uval)); + WARN_errno( rc == SOCKET_ERROR, "multicast ttl" ); + } + #ifdef HAVE_IPV6_MULTICAST diff --git a/net/iperf2/patches/patch-src_PerfSocket.cpp b/net/iperf2/patches/patch-src_PerfSocket.cpp new file mode 100644 index 00000000000..737408575aa --- /dev/null +++ b/net/iperf2/patches/patch-src_PerfSocket.cpp @@ -0,0 +1,20 @@ +$NetBSD: patch-src_PerfSocket.cpp,v 1.1 2021/03/15 16:44:32 gdt Exp $ + +Fix bug where setsockopt was used with int when it is defined to use +unsigned char. This should avoid bugs on BE machines. + +Not yet reported upstream. + +--- src/PerfSocket.cpp.orig 2019-01-22 20:31:18.000000000 +0000 ++++ src/PerfSocket.cpp +@@ -120,8 +120,9 @@ void SetSocketOptions( thread_Settings * + // set TTL + int val = inSettings->mTTL; + if ( !isIPV6(inSettings) ) { ++ u_char uval = val; + int rc = setsockopt( inSettings->mSock, IPPROTO_IP, IP_MULTICAST_TTL, +- (char*) &val, (Socklen_t) sizeof(val)); ++ (char*) &uval, (Socklen_t) sizeof(val)); + + WARN_errno( rc == SOCKET_ERROR, "multicast v4 ttl" ); + } else -- cgit v1.2.3