diff options
author | Tiziano Müller <dev-zero@gentoo.org> | 2013-09-05 16:04:40 +0000 |
---|---|---|
committer | Tiziano Müller <dev-zero@gentoo.org> | 2013-09-05 16:04:40 +0000 |
commit | e7b82c9e4b017a1016cc2cc054079700709a0929 (patch) | |
tree | 4b02247c0b22985776e63bde18042a701c0e65f9 /net-misc/iperf | |
parent | Stable for HPPA (bug #477152). (diff) | |
download | gentoo-2-e7b82c9e4b017a1016cc2cc054079700709a0929.tar.gz gentoo-2-e7b82c9e4b017a1016cc2cc054079700709a0929.tar.bz2 gentoo-2-e7b82c9e4b017a1016cc2cc054079700709a0929.zip |
Rewrite init.d-script to avoid -D as a workaround for bug #344875, import some important patches from Debian/Ubuntu.
(Portage version: 2.1.11.63/cvs/Linux x86_64, signed Manifest commit with key 0x1E0CA85F!)
Diffstat (limited to 'net-misc/iperf')
-rw-r--r-- | net-misc/iperf/ChangeLog | 16 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf-bidirectional-tcp-server.patch | 23 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf-cast-to-max_size_t-instead-of-int.patch | 20 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf-die-on-bind-fail.patch | 19 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf-fix-format-security-ftbfs.patch | 100 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf-ipv6_mcast_check.patch | 22 | ||||
-rw-r--r-- | net-misc/iperf/files/iperf.initd-r1 | 19 | ||||
-rw-r--r-- | net-misc/iperf/iperf-2.0.5-r2.ebuild | 50 |
8 files changed, 267 insertions, 2 deletions
diff --git a/net-misc/iperf/ChangeLog b/net-misc/iperf/ChangeLog index 80a13ff5125f..f6610cf433ec 100644 --- a/net-misc/iperf/ChangeLog +++ b/net-misc/iperf/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for net-misc/iperf -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/iperf/ChangeLog,v 1.43 2012/10/06 13:43:23 pinkbyte Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/iperf/ChangeLog,v 1.44 2013/09/05 16:04:40 dev-zero Exp $ + +*iperf-2.0.5-r2 (05 Sep 2013) + + 05 Sep 2013; Tiziano Müller <dev-zero@gentoo.org> + +files/iperf-bidirectional-tcp-server.patch, + +files/iperf-cast-to-max_size_t-instead-of-int.patch, + +files/iperf-die-on-bind-fail.patch, + +files/iperf-fix-format-security-ftbfs.patch, + +files/iperf-ipv6_mcast_check.patch, +files/iperf.initd-r1, + +iperf-2.0.5-r2.ebuild: + Rewrite init.d-script to avoid -D as a workaround for bug #344875, import some + important patches from Debian/Ubuntu. 06 Oct 2012; Sergey Popov <pinkbyte@gentoo.org> iperf-2.0.5.ebuild, iperf-2.0.5-r1.ebuild: diff --git a/net-misc/iperf/files/iperf-bidirectional-tcp-server.patch b/net-misc/iperf/files/iperf-bidirectional-tcp-server.patch new file mode 100644 index 000000000000..571b73c9c664 --- /dev/null +++ b/net-misc/iperf/files/iperf-bidirectional-tcp-server.patch @@ -0,0 +1,23 @@ +Description: Fix bidirectional TCP server exiting after the test + iperf bidirectional test using parameter -r or -d doesn't work as + expected, the server exits after the test, but it should continue listening + for new connections. +Author: Roberto Lumbreras <rover@debian.org> +Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=449796 +Forwarded: http://sourceforge.net/tracker/?func=detail&aid=1983829&group_id=128336&atid=711371 + +--- iperf-2.0.5.orig/src/Client.cpp ++++ iperf-2.0.5/src/Client.cpp +@@ -212,10 +212,12 @@ void Client::Run( void ) { + char* readAt = mBuf; + + #if HAVE_THREAD ++ /* + if ( !isUDP( mSettings ) ) { + RunTCP(); + return; + } ++ */ + #endif + + // Indicates if the stream is readable diff --git a/net-misc/iperf/files/iperf-cast-to-max_size_t-instead-of-int.patch b/net-misc/iperf/files/iperf-cast-to-max_size_t-instead-of-int.patch new file mode 100644 index 000000000000..8919d81c012b --- /dev/null +++ b/net-misc/iperf/files/iperf-cast-to-max_size_t-instead-of-int.patch @@ -0,0 +1,20 @@ +Description: iperf does not handle right large time values + Reported by Eugene Butan <eugene@mikrotik.com> + When I invoke 'iperf' with '-t 100000000' argument from an ordinary shell + prompt it immediately exits displaying incorrect bandwidth. If I supply + smaller time value, iperf works as expected. +Author: Roberto Lumbreras <rover@debian.org> +Bug-Debian: http://bugs.debian.org/346099 +Forwarded: https://sourceforge.net/tracker/index.php?func=detail&aid=3140391&group_id=128336&atid=711371 + +--- iperf-2.0.4.orig/src/Settings.cpp.orig 2008-04-08 04:37:54.000000000 +0200 ++++ iperf-2.0.4/src/Settings.cpp 2008-05-07 17:41:03.923942801 +0200 +@@ -458,7 +458,7 @@ + case 't': // seconds to write for + // time mode (instead of amount mode) + setModeTime( mExtSettings ); +- mExtSettings->mAmount = (int) (atof( optarg ) * 100.0); ++ mExtSettings->mAmount = (max_size_t) (atof( optarg ) * 100.0); + break; + + case 'u': // UDP instead of TCP diff --git a/net-misc/iperf/files/iperf-die-on-bind-fail.patch b/net-misc/iperf/files/iperf-die-on-bind-fail.patch new file mode 100644 index 000000000000..4dca6db8d985 --- /dev/null +++ b/net-misc/iperf/files/iperf-die-on-bind-fail.patch @@ -0,0 +1,19 @@ +Description: iperf die on bind fail + When iperf encounters a fatal error when binding to a port, such as + the port being already in use or lacking permission, it fails to give + fatal error, but instead pretends to continue to listen on the port. +Author: Deny IP Any Any <denyipanyany@gmail.com> +Bug-Debian: http://bugs.debian.org/517239 +Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3140400&group_id=128336&atid=711371 + +--- iperf-2.0.4/src/Listener.cpp 2009-02-23 16:20:31.000000000 -0500 ++++ iperf-2.0.4-fixed/src/Listener.cpp 2009-02-23 16:20:40.000000000 -0500 +@@ -333,7 +333,7 @@ + #endif + { + rc = bind( mSettings->mSock, (sockaddr*) &mSettings->local, mSettings->size_local ); +- WARN_errno( rc == SOCKET_ERROR, "bind" ); ++ FAIL_errno( rc == SOCKET_ERROR, "bind", mSettings ); + } + // listen for connections (TCP only). + // default backlog traditionally 5 diff --git a/net-misc/iperf/files/iperf-fix-format-security-ftbfs.patch b/net-misc/iperf/files/iperf-fix-format-security-ftbfs.patch new file mode 100644 index 000000000000..ee2e67b085d0 --- /dev/null +++ b/net-misc/iperf/files/iperf-fix-format-security-ftbfs.patch @@ -0,0 +1,100 @@ +Description: iperf format string FTBFS with -Werror=format-security + Reported by Didier Raboud <odyx@debian.org> +Author: Simon Paillard <spaillard@debian.org> +Bug-Debian: http://bugs.debian.org/643408 + +diff -Nur iperf-2.0.5/compat/Thread.c iperf-2.0.5-nmu/compat/Thread.c +--- iperf-2.0.5/compat/Thread.c 2010-03-31 01:08:24.000000000 +0200 ++++ iperf-2.0.5-nmu/compat/Thread.c 2011-11-15 09:13:32.000000000 +0100 +@@ -381,7 +381,7 @@ + Condition_Lock( thread_sNum_cond ); + thread_sNum -= nonterminating_num; + if ( thread_sNum > 1 && nonterminating_num > 0 && interrupt != 0 ) { +- fprintf( stderr, wait_server_threads ); ++ fprintf( stderr, "%s", wait_server_threads ); + } + nonterminating_num = 0; + Condition_Signal( &thread_sNum_cond ); +diff -Nur iperf-2.0.5/src/ReportDefault.c iperf-2.0.5-nmu/src/ReportDefault.c +--- iperf-2.0.5/src/ReportDefault.c 2010-03-31 00:57:17.000000000 +0200 ++++ iperf-2.0.5-nmu/src/ReportDefault.c 2011-11-15 09:16:52.000000000 +0100 +@@ -78,7 +78,7 @@ + if ( stats->mUDP != (char)kMode_Server ) { + // TCP Reporting + if( !header_printed ) { +- printf( report_bw_header); ++ printf( "%s", report_bw_header); + header_printed = 1; + } + printf( report_bw_format, stats->transferID, +@@ -87,7 +87,7 @@ + } else { + // UDP Reporting + if( !header_printed ) { +- printf( report_bw_jitter_loss_header); ++ printf( "%s", report_bw_jitter_loss_header); + header_printed = 1; + } + printf( report_bw_jitter_loss_format, stats->transferID, +@@ -159,7 +159,7 @@ + (data->mThreadMode == kMode_Listener ? 0 : 1) ); + win_requested = data->mTCPWin; + +- printf( separator_line ); ++ printf( "%s", separator_line ); + if ( data->mThreadMode == kMode_Listener ) { + printf( server_port, + (isUDP( data ) ? "UDP" : "TCP"), +@@ -198,7 +198,7 @@ + printf( warn_window_requested, buffer ); + } + printf( "\n" ); +- printf( separator_line ); ++ printf( "%s", separator_line ); + } + + /* +@@ -286,7 +286,7 @@ + } else if ( checkMSS_MTU( inMSS, 576 ) ) { + net = "minimum"; + mtu = 576; +- printf( warn_no_pathmtu ); ++ printf( "%s", warn_no_pathmtu ); + } else { + mtu = inMSS + 40; + net = "unknown interface"; +diff -Nur iperf-2.0.5/src/Reporter.c iperf-2.0.5-nmu/src/Reporter.c +--- iperf-2.0.5/src/Reporter.c 2011-11-15 19:44:41.000000000 +0100 ++++ iperf-2.0.5-nmu/src/Reporter.c 2011-11-15 09:17:14.000000000 +0100 +@@ -896,7 +896,7 @@ + } else if ( checkMSS_MTU( inMSS, 576 ) ) { + net = "minimum"; + mtu = 576; +- printf( warn_no_pathmtu ); ++ printf( "%s", warn_no_pathmtu ); + } else { + mtu = inMSS + 40; + net = "unknown interface"; +diff -Nur iperf-2.0.5/src/Settings.cpp iperf-2.0.5-nmu/src/Settings.cpp +--- iperf-2.0.5/src/Settings.cpp 2011-11-15 19:44:41.000000000 +0100 ++++ iperf-2.0.5-nmu/src/Settings.cpp 2011-11-15 09:18:46.000000000 +0100 +@@ -375,8 +375,8 @@ + break; + + case 'h': // print help and exit +- fprintf(stderr, usage_long1); +- fprintf(stderr, usage_long2); ++ fprintf(stderr, "%s", usage_long1); ++ fprintf(stderr, "%s", usage_long2); + exit(1); + break; + +@@ -482,7 +482,7 @@ + break; + + case 'v': // print version and exit +- fprintf( stderr, version ); ++ fprintf( stderr, "%s", version ); + exit(1); + break; + diff --git a/net-misc/iperf/files/iperf-ipv6_mcast_check.patch b/net-misc/iperf/files/iperf-ipv6_mcast_check.patch new file mode 100644 index 000000000000..cd700a6b67c1 --- /dev/null +++ b/net-misc/iperf/files/iperf-ipv6_mcast_check.patch @@ -0,0 +1,22 @@ +Description: Fix improper check for IPv6 family when sending multicast
+ This patch fixes the proper behavior of -T (hop-limit setting) when
+ sending IPv6 multicast packets. Due to this bug, it was always fixed to 1.
+ .
+ SetSocketOptions() is called before socket connection, thus sa_family is
+ still set to 0. This is causing the if-branch in the multicast check
+ to always assume a non-IPv6 socket.
+ Checking the remote-peer family works reliably, instead.
+Author: Luca Bruno <lucab@debian.org>
+Last-Update: 2012-05-24
+
+--- iperf-2.0.5.orig/src/PerfSocket.cpp
++++ iperf-2.0.5/src/PerfSocket.cpp
+@@ -109,7 +109,7 @@ void SetSocketOptions( thread_Settings *
+ if ( isMulticast( inSettings ) && ( inSettings->mTTL > 0 ) ) {
+ int val = inSettings->mTTL;
+ #ifdef HAVE_MULTICAST
+- if ( !SockAddr_isIPv6( &inSettings->local ) ) {
++ if ( !SockAddr_isIPv6( &inSettings->peer ) ) {
+ int rc = setsockopt( inSettings->mSock, IPPROTO_IP, IP_MULTICAST_TTL,
+ (const void*) &val, (Socklen_t) sizeof(val));
+
diff --git a/net-misc/iperf/files/iperf.initd-r1 b/net-misc/iperf/files/iperf.initd-r1 new file mode 100644 index 000000000000..bc08a4adf00b --- /dev/null +++ b/net-misc/iperf/files/iperf.initd-r1 @@ -0,0 +1,19 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/iperf/files/iperf.initd-r1,v 1.1 2013/09/05 16:04:40 dev-zero Exp $ + +description="IP bandwidth measurement server" +command="/usr/bin/iperf" + +command_background="yes" +pidfile="/run/${SVCNAME}.pid" +command_args="-s ${IPERF_OPTS}" + +# note: iperf has a daemon flag but we seem to hit a bug +# where it starts to eat all CPU after client disconnect, +# see bug #344875 + +depend() { + need net +} diff --git a/net-misc/iperf/iperf-2.0.5-r2.ebuild b/net-misc/iperf/iperf-2.0.5-r2.ebuild new file mode 100644 index 000000000000..2c8ea547bb1b --- /dev/null +++ b/net-misc/iperf/iperf-2.0.5-r2.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/iperf/iperf-2.0.5-r2.ebuild,v 1.1 2013/09/05 16:04:40 dev-zero Exp $ + +EAPI="5" + +inherit base + +DESCRIPTION="Tool to measure IP bandwidth using UDP or TCP" +HOMEPAGE="http://iperf.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="HPND" +SLOT="0" +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint" +IUSE="ipv6 threads debug" + +DEPEND="" +RDEPEND="" + +PATCHES=( + "${FILESDIR}"/"${PN}"-fix-bandwidth-limit.patch + "${FILESDIR}"/"${PN}"-cast-to-max_size_t-instead-of-int.patch + "${FILESDIR}"/"${PN}"-die-on-bind-fail.patch + "${FILESDIR}"/"${PN}"-bidirectional-tcp-server.patch + "${FILESDIR}"/"${PN}"-fix-format-security-ftbfs.patch + "${FILESDIR}"/"${PN}"-ipv6_mcast_check.patch + ) +DOCS="INSTALL README" + +src_configure() { + econf \ + $(use_enable ipv6) \ + $(use_enable threads) \ + $(use_enable debug debuginfo) +} + +src_install() { + default + dohtml doc/* + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} + +pkg_postinst() { + echo + einfo "To run iperf in server mode, run:" + einfo " /etc/init.d/iperf start" + echo +} |