Patchwork [10/12] iperf: Add patches from Debian

login
register
mail settings
Submitter Morten Svendsen
Date Nov. 21, 2012, 10:36 p.m.
Message ID <1c4c28f2d59bc2a86f8910a6a57032d9c6ac5b7b.1353493728.git.Morten.ThunbergSvendsen@prevas.dk>
Download mbox | patch
Permalink /patch/200880/
State Accepted
Headers show

Comments

Morten Svendsen - Nov. 21, 2012, 10:36 p.m.
---
 .../001-cast-to-max_size_t-instead-of-int.patch    |   20 +++
 recipes/iperf/iperf-2.0.5/002-typo-recieve.patch   |   25 +++
 .../003-fix-hyphen-used-as-minus-sign.patch        |  177 ++++++++++++++++++++
 .../iperf-2.0.5/005-iperf-die-on-bind-fail.patch   |   19 +++
 .../iperf-2.0.5/006-bidirectional-tcp-server.patch |   23 +++
 .../010-fix-format-security-ftbfs.patch            |  100 +++++++++++
 .../iperf/iperf-2.0.5/011-ipv6_mcast_check.patch   |   22 +++
 recipes/iperf/iperf_2.0.5.oe                       |    9 +
 8 files changed, 395 insertions(+)
 create mode 100644 recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch
 create mode 100644 recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch
Esben Haabendal - Dec. 14, 2012, 6:28 p.m.
Morten Thunberg Svendsen <Morten.ThunbergSvendsen@prevas.dk> writes:

> ---
>  .../001-cast-to-max_size_t-instead-of-int.patch    |   20 +++
>  recipes/iperf/iperf-2.0.5/002-typo-recieve.patch   |   25 +++
>  .../003-fix-hyphen-used-as-minus-sign.patch        |  177 ++++++++++++++++++++
>  .../iperf-2.0.5/005-iperf-die-on-bind-fail.patch   |   19 +++
>  .../iperf-2.0.5/006-bidirectional-tcp-server.patch |   23 +++
>  .../010-fix-format-security-ftbfs.patch            |  100 +++++++++++
>  .../iperf/iperf-2.0.5/011-ipv6_mcast_check.patch   |   22 +++
>  recipes/iperf/iperf_2.0.5.oe                       |    9 +
>  8 files changed, 395 insertions(+)
>  create mode 100644 recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch
>  create mode 100644 recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch
>
> diff --git a/recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch b/recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch
> new file mode 100644
> index 0000000..8919d81
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/001-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/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch b/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
> new file mode 100644
> index 0000000..515da8b
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
> @@ -0,0 +1,25 @@
> +Description: fix receive typo
> +Author: Roberto Lumbreras <rover@debian.org>
> +
> +--- a/man/iperf.1	2010-12-19 21:19:11.871168845 +0100
> ++++ b/man/iperf.1	2010-12-19 21:19:22.811557617 +0100
> +@@ -116,7 +116,7 @@
> + input the data to be transmitted from stdin
> + .TP
> + .BR -L ", " --listenport " \fIn\fR"
> +-port to recieve bidirectional tests back on
> ++port to receive bidirectional tests back on
> + .TP
> + .BR -P ", " --parallel " \fIn\fR"
> + number of parallel client threads to run
> +--- a/src/Reporter.c	2010-12-19 21:18:27.667170232 +0100
> ++++ b/src/Reporter.c	2010-12-19 21:18:51.969392521 +0100
> +@@ -681,7 +681,7 @@
> +             data->TotalLen += packet->packetLen;
> +         }
> +     } else {
> +-        // update recieved amount and time
> ++        // update received amount and time
> +         data->packetTime = packet->packetTime;
> +         reporter_condprintstats( &reporthdr->report, reporthdr->multireport, finished );
> +         data->TotalLen += packet->packetLen;
> diff --git a/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch b/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
> new file mode 100644
> index 0000000..d04a80b
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
> @@ -0,0 +1,177 @@
> +Description: fix hyphen used as minus sign in manpages
> +Author: Roberto Lumbreras <rover@debian.org>
> +
> +--- iperf-2.0.4.orig/man/iperf.1	2008-08-21 00:21:49.290527643 +0200
> ++++ iperf-2.0.4/man/iperf.1	2008-08-21 00:35:17.850640445 +0200
> +@@ -2,21 +2,21 @@
> + .SH NAME
> + iperf \- perform network throughput tests
> + .SH SYNOPSIS
> +-.B iperf -s [
> ++.B iperf \-s [
> + .I options
> + .B ]
> + 
> +-.B iperf -c 
> ++.B iperf \-c 
> + .I server
> + .B [
> + .I options
> + .B ]
> + 
> +-.B iperf -u -s [
> ++.B iperf \-u \-s [
> + .I options
> + .B ]
> + 
> +-.B iperf -u -c 
> ++.B iperf \-u \-c 
> + .I server
> + .B [
> + .I options
> +@@ -28,103 +28,103 @@
> + traffic).  
> + .SH "GENERAL OPTIONS"
> + .TP
> +-.BR -f ", " --format " "
> ++.BR \-f ", " \-\-format " "
> + [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes
> + .TP
> +-.BR -h ", " --help " "
> ++.BR \-h ", " \-\-help " "
> + print a help synopsis
> + .TP
> +-.BR -i ", " --interval " \fIn\fR"
> ++.BR \-i ", " \-\-interval " \fIn\fR"
> + pause \fIn\fR seconds between periodic bandwidth reports
> + .TP
> +-.BR -l ", " --len " \fIn\fR[KM]"
> ++.BR \-l ", " \-\-len " \fIn\fR[KM]"
> + set length read/write buffer to \fIn\fR (default 8 KB)
> + .TP
> +-.BR -m ", " --print_mss " "
> ++.BR \-m ", " \-\-print_mss " "
> + print TCP maximum segment size (MTU - TCP/IP header)
> + .TP
> +-.BR -o ", " --output " <filename>"
> ++.BR \-o ", " \-\-output " <filename>"
> + output the report or error message to this specified file
> + .TP
> +-.BR -p ", " --port " \fIn\fR"
> ++.BR \-p ", " \-\-port " \fIn\fR"
> + set server port to listen on/connect to to \fIn\fR (default 5001)
> + .TP
> +-.BR -u ", " --udp " "
> ++.BR \-u ", " \-\-udp " "
> + use UDP rather than TCP
> + .TP
> +-.BR -w ", " --window " \fIn\fR[KM]"
> ++.BR \-w ", " \-\-window " \fIn\fR[KM]"
> + TCP window size (socket buffer size)
> + .TP
> +-.BR -B ", " --bind " <host>"
> ++.BR \-B ", " \-\-bind " <host>"
> + bind to <host>, an interface or multicast address
> + .TP
> +-.BR -C ", " --compatibility " "
> ++.BR \-C ", " \-\-compatibility " "
> + for use with older versions does not sent extra msgs
> + .TP
> +-.BR -M ", " --mss " \fIn\fR"
> ++.BR \-M ", " \-\-mss " \fIn\fR"
> + set TCP maximum segment size (MTU - 40 bytes)
> + .TP
> +-.BR -N ", " --nodelay " "
> ++.BR \-N ", " \-\-nodelay " "
> + set TCP no delay, disabling Nagle's Algorithm
> + .TP
> +-.BR -v ", " --version " "
> ++.BR \-v ", " \-\-version " "
> + print version information and quit
> + .TP
> +-.BR -V ", " --IPv6Version " "
> ++.BR \-V ", " \-\-IPv6Version " "
> + Set the domain to IPv6
> + .TP
> +-.BR -x ", " --reportexclude " "
> ++.BR \-x ", " \-\-reportexclude " "
> + [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
> + .TP
> +-.BR -y ", " --reportstyle " C|c"
> ++.BR \-y ", " \-\-reportstyle " C|c"
> + if set to C or c report results as CSV (comma separated values)
> + .SH "SERVER SPECIFIC OPTIONS"
> + .TP
> +-.BR -s ", " --server " "
> ++.BR \-s ", " \-\-server " "
> + run in server mode
> + .TP
> +-.BR -U ", " --single_udp " "
> ++.BR \-U ", " \-\-single_udp " "
> + run in single threaded UDP mode
> + .TP
> +-.BR -D ", " --daemon " "
> ++.BR \-D ", " \-\-daemon " "
> + run the server as a daemon
> + .SH "CLIENT SPECIFIC OPTIONS"
> + .TP
> +-.BR -b ", " --bandwidth " \fIn\fR[KM]"
> ++.BR \-b ", " \-\-bandwidth " \fIn\fR[KM]"
> + set target bandwidth to \fIn\fR bits/sec (default 1 Mbit/sec).
> +-This setting requires UDP (-u).
> ++This setting requires UDP (\-u).
> + .TP
> +-.BR -c ", " --client " <host>"
> ++.BR \-c ", " \-\-client " <host>"
> + run in client mode, connecting to <host>
> + .TP
> +-.BR -d ", " --dualtest " "
> ++.BR \-d ", " \-\-dualtest " "
> + Do a bidirectional test simultaneously
> + .TP
> +-.BR -n ", " --num " \fIn\fR[KM]"
> +-number of bytes to transmit (instead of -t)
> ++.BR \-n ", " \-\-num " \fIn\fR[KM]"
> ++number of bytes to transmit (instead of \-t)
> + .TP
> +-.BR -r ", " --tradeoff " "
> ++.BR \-r ", " \-\-tradeoff " "
> + Do a bidirectional test individually
> + .TP
> +-.BR -t ", " --time " \fIn\fR"
> ++.BR \-t ", " \-\-time " \fIn\fR"
> + time in seconds to transmit for (default 10 secs)
> + .TP
> +-.BR -F ", " --fileinput " <name>"
> ++.BR \-F ", " \-\-fileinput " <name>"
> + input the data to be transmitted from a file
> + .TP
> +-.BR -I ", " --stdin " "
> ++.BR \-I ", " \-\-stdin " "
> + input the data to be transmitted from stdin
> + .TP
> +-.BR -L ", " --listenport " \fIn\fR"
> ++.BR \-L ", " \-\-listenport " \fIn\fR"
> + port to receive bidirectional tests back on
> + .TP
> +-.BR -P ", " --parallel " \fIn\fR"
> ++.BR \-P ", " \-\-parallel " \fIn\fR"
> + number of parallel client threads to run
> + .TP
> +-.BR -T ", " --ttl " \fIn\fR"
> ++.BR \-T ", " \-\-ttl " \fIn\fR"
> + time-to-live, for multicast (default 1)
> + .TP
> +-.BR -Z ", " --linux-congestion " <algo>"
> ++.BR \-Z ", " \-\-linux\-congestion " <algo>"
> + set TCP congestion control algorithm (Linux only)
> + .SH ENVIRONMENT
> + .TP
> +@@ -143,6 +143,6 @@
> + Kevin Gibbs,
> + John Estabrook <jestabro at ncsa.uiuc.edu>,
> + Andrew Gallatin <gallatin at gmail.com>,
> +-Stephen Hemminger <shemminger at linux-foundation.org>
> ++Stephen Hemminger <shemminger at linux\-foundation.org>
> + .SH "SEE ALSO"
> + http://iperf.sourceforge.net/
> diff --git a/recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch b/recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch
> new file mode 100644
> index 0000000..4dca6db
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/005-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/recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch b/recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch
> new file mode 100644
> index 0000000..571b73c
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/006-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/recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch b/recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch
> new file mode 100644
> index 0000000..ee2e67b
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/010-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/recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch b/recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch
> new file mode 100644
> index 0000000..cd700a6
> --- /dev/null
> +++ b/recipes/iperf/iperf-2.0.5/011-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/recipes/iperf/iperf_2.0.5.oe b/recipes/iperf/iperf_2.0.5.oe
> index eb17535..f58edee 100644
> --- a/recipes/iperf/iperf_2.0.5.oe
> +++ b/recipes/iperf/iperf_2.0.5.oe
> @@ -1 +1,10 @@
>  require iperf.inc
> +SRC_URI += " \
> +file://001-cast-to-max_size_t-instead-of-int.patch \
> +file://002-typo-recieve.patch \
> +file://003-fix-hyphen-used-as-minus-sign.patch \
> +file://005-iperf-die-on-bind-fail.patch \
> +file://006-bidirectional-tcp-server.patch \
> +file://010-fix-format-security-ftbfs.patch \
> +file://011-ipv6_mcast_check.patch \
> +"

Merged to master, thanks.

/Esben

Patch

diff --git a/recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch b/recipes/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch
new file mode 100644
index 0000000..8919d81
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/001-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/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch b/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
new file mode 100644
index 0000000..515da8b
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/002-typo-recieve.patch
@@ -0,0 +1,25 @@ 
+Description: fix receive typo
+Author: Roberto Lumbreras <rover@debian.org>
+
+--- a/man/iperf.1	2010-12-19 21:19:11.871168845 +0100
++++ b/man/iperf.1	2010-12-19 21:19:22.811557617 +0100
+@@ -116,7 +116,7 @@
+ input the data to be transmitted from stdin
+ .TP
+ .BR -L ", " --listenport " \fIn\fR"
+-port to recieve bidirectional tests back on
++port to receive bidirectional tests back on
+ .TP
+ .BR -P ", " --parallel " \fIn\fR"
+ number of parallel client threads to run
+--- a/src/Reporter.c	2010-12-19 21:18:27.667170232 +0100
++++ b/src/Reporter.c	2010-12-19 21:18:51.969392521 +0100
+@@ -681,7 +681,7 @@
+             data->TotalLen += packet->packetLen;
+         }
+     } else {
+-        // update recieved amount and time
++        // update received amount and time
+         data->packetTime = packet->packetTime;
+         reporter_condprintstats( &reporthdr->report, reporthdr->multireport, finished );
+         data->TotalLen += packet->packetLen;
diff --git a/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch b/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
new file mode 100644
index 0000000..d04a80b
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch
@@ -0,0 +1,177 @@ 
+Description: fix hyphen used as minus sign in manpages
+Author: Roberto Lumbreras <rover@debian.org>
+
+--- iperf-2.0.4.orig/man/iperf.1	2008-08-21 00:21:49.290527643 +0200
++++ iperf-2.0.4/man/iperf.1	2008-08-21 00:35:17.850640445 +0200
+@@ -2,21 +2,21 @@
+ .SH NAME
+ iperf \- perform network throughput tests
+ .SH SYNOPSIS
+-.B iperf -s [
++.B iperf \-s [
+ .I options
+ .B ]
+ 
+-.B iperf -c 
++.B iperf \-c 
+ .I server
+ .B [
+ .I options
+ .B ]
+ 
+-.B iperf -u -s [
++.B iperf \-u \-s [
+ .I options
+ .B ]
+ 
+-.B iperf -u -c 
++.B iperf \-u \-c 
+ .I server
+ .B [
+ .I options
+@@ -28,103 +28,103 @@
+ traffic).  
+ .SH "GENERAL OPTIONS"
+ .TP
+-.BR -f ", " --format " "
++.BR \-f ", " \-\-format " "
+ [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes
+ .TP
+-.BR -h ", " --help " "
++.BR \-h ", " \-\-help " "
+ print a help synopsis
+ .TP
+-.BR -i ", " --interval " \fIn\fR"
++.BR \-i ", " \-\-interval " \fIn\fR"
+ pause \fIn\fR seconds between periodic bandwidth reports
+ .TP
+-.BR -l ", " --len " \fIn\fR[KM]"
++.BR \-l ", " \-\-len " \fIn\fR[KM]"
+ set length read/write buffer to \fIn\fR (default 8 KB)
+ .TP
+-.BR -m ", " --print_mss " "
++.BR \-m ", " \-\-print_mss " "
+ print TCP maximum segment size (MTU - TCP/IP header)
+ .TP
+-.BR -o ", " --output " <filename>"
++.BR \-o ", " \-\-output " <filename>"
+ output the report or error message to this specified file
+ .TP
+-.BR -p ", " --port " \fIn\fR"
++.BR \-p ", " \-\-port " \fIn\fR"
+ set server port to listen on/connect to to \fIn\fR (default 5001)
+ .TP
+-.BR -u ", " --udp " "
++.BR \-u ", " \-\-udp " "
+ use UDP rather than TCP
+ .TP
+-.BR -w ", " --window " \fIn\fR[KM]"
++.BR \-w ", " \-\-window " \fIn\fR[KM]"
+ TCP window size (socket buffer size)
+ .TP
+-.BR -B ", " --bind " <host>"
++.BR \-B ", " \-\-bind " <host>"
+ bind to <host>, an interface or multicast address
+ .TP
+-.BR -C ", " --compatibility " "
++.BR \-C ", " \-\-compatibility " "
+ for use with older versions does not sent extra msgs
+ .TP
+-.BR -M ", " --mss " \fIn\fR"
++.BR \-M ", " \-\-mss " \fIn\fR"
+ set TCP maximum segment size (MTU - 40 bytes)
+ .TP
+-.BR -N ", " --nodelay " "
++.BR \-N ", " \-\-nodelay " "
+ set TCP no delay, disabling Nagle's Algorithm
+ .TP
+-.BR -v ", " --version " "
++.BR \-v ", " \-\-version " "
+ print version information and quit
+ .TP
+-.BR -V ", " --IPv6Version " "
++.BR \-V ", " \-\-IPv6Version " "
+ Set the domain to IPv6
+ .TP
+-.BR -x ", " --reportexclude " "
++.BR \-x ", " \-\-reportexclude " "
+ [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
+ .TP
+-.BR -y ", " --reportstyle " C|c"
++.BR \-y ", " \-\-reportstyle " C|c"
+ if set to C or c report results as CSV (comma separated values)
+ .SH "SERVER SPECIFIC OPTIONS"
+ .TP
+-.BR -s ", " --server " "
++.BR \-s ", " \-\-server " "
+ run in server mode
+ .TP
+-.BR -U ", " --single_udp " "
++.BR \-U ", " \-\-single_udp " "
+ run in single threaded UDP mode
+ .TP
+-.BR -D ", " --daemon " "
++.BR \-D ", " \-\-daemon " "
+ run the server as a daemon
+ .SH "CLIENT SPECIFIC OPTIONS"
+ .TP
+-.BR -b ", " --bandwidth " \fIn\fR[KM]"
++.BR \-b ", " \-\-bandwidth " \fIn\fR[KM]"
+ set target bandwidth to \fIn\fR bits/sec (default 1 Mbit/sec).
+-This setting requires UDP (-u).
++This setting requires UDP (\-u).
+ .TP
+-.BR -c ", " --client " <host>"
++.BR \-c ", " \-\-client " <host>"
+ run in client mode, connecting to <host>
+ .TP
+-.BR -d ", " --dualtest " "
++.BR \-d ", " \-\-dualtest " "
+ Do a bidirectional test simultaneously
+ .TP
+-.BR -n ", " --num " \fIn\fR[KM]"
+-number of bytes to transmit (instead of -t)
++.BR \-n ", " \-\-num " \fIn\fR[KM]"
++number of bytes to transmit (instead of \-t)
+ .TP
+-.BR -r ", " --tradeoff " "
++.BR \-r ", " \-\-tradeoff " "
+ Do a bidirectional test individually
+ .TP
+-.BR -t ", " --time " \fIn\fR"
++.BR \-t ", " \-\-time " \fIn\fR"
+ time in seconds to transmit for (default 10 secs)
+ .TP
+-.BR -F ", " --fileinput " <name>"
++.BR \-F ", " \-\-fileinput " <name>"
+ input the data to be transmitted from a file
+ .TP
+-.BR -I ", " --stdin " "
++.BR \-I ", " \-\-stdin " "
+ input the data to be transmitted from stdin
+ .TP
+-.BR -L ", " --listenport " \fIn\fR"
++.BR \-L ", " \-\-listenport " \fIn\fR"
+ port to receive bidirectional tests back on
+ .TP
+-.BR -P ", " --parallel " \fIn\fR"
++.BR \-P ", " \-\-parallel " \fIn\fR"
+ number of parallel client threads to run
+ .TP
+-.BR -T ", " --ttl " \fIn\fR"
++.BR \-T ", " \-\-ttl " \fIn\fR"
+ time-to-live, for multicast (default 1)
+ .TP
+-.BR -Z ", " --linux-congestion " <algo>"
++.BR \-Z ", " \-\-linux\-congestion " <algo>"
+ set TCP congestion control algorithm (Linux only)
+ .SH ENVIRONMENT
+ .TP
+@@ -143,6 +143,6 @@
+ Kevin Gibbs,
+ John Estabrook <jestabro at ncsa.uiuc.edu>,
+ Andrew Gallatin <gallatin at gmail.com>,
+-Stephen Hemminger <shemminger at linux-foundation.org>
++Stephen Hemminger <shemminger at linux\-foundation.org>
+ .SH "SEE ALSO"
+ http://iperf.sourceforge.net/
diff --git a/recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch b/recipes/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch
new file mode 100644
index 0000000..4dca6db
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/005-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/recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch b/recipes/iperf/iperf-2.0.5/006-bidirectional-tcp-server.patch
new file mode 100644
index 0000000..571b73c
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/006-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/recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch b/recipes/iperf/iperf-2.0.5/010-fix-format-security-ftbfs.patch
new file mode 100644
index 0000000..ee2e67b
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/010-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/recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch b/recipes/iperf/iperf-2.0.5/011-ipv6_mcast_check.patch
new file mode 100644
index 0000000..cd700a6
--- /dev/null
+++ b/recipes/iperf/iperf-2.0.5/011-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/recipes/iperf/iperf_2.0.5.oe b/recipes/iperf/iperf_2.0.5.oe
index eb17535..f58edee 100644
--- a/recipes/iperf/iperf_2.0.5.oe
+++ b/recipes/iperf/iperf_2.0.5.oe
@@ -1 +1,10 @@ 
 require iperf.inc
+SRC_URI += " \
+file://001-cast-to-max_size_t-instead-of-int.patch \
+file://002-typo-recieve.patch \
+file://003-fix-hyphen-used-as-minus-sign.patch \
+file://005-iperf-die-on-bind-fail.patch \
+file://006-bidirectional-tcp-server.patch \
+file://010-fix-format-security-ftbfs.patch \
+file://011-ipv6_mcast_check.patch \
+"