Hello community,

here is the log from the commit of package iperf for openSUSE:Factory checked 
in at 2016-02-11 12:37:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/iperf (Old)
 and      /work/SRC/openSUSE:Factory/.iperf.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "iperf"

Changes:
--------
--- /work/SRC/openSUSE:Factory/iperf/iperf.changes      2015-12-09 
19:49:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.iperf.new/iperf.changes 2016-02-11 
12:37:42.000000000 +0100
@@ -1,0 +2,17 @@
+Mon Feb  8 16:30:00 UTC 2016 - ms...@suse.com
+
+- update to version 3.1.2
+  * Bug fixes
+
+-------------------------------------------------------------------
+Mon Feb  8 15:26:43 UTC 2016 - plinn...@opensuse.org
+
+- Fix url so OBS is happy.
+
+-------------------------------------------------------------------
+Mon Dec 14 10:10:42 UTC 2015 - ms...@suse.com
+
+- update to version 3.1.1
+  * Minor bugfixes
+
+-------------------------------------------------------------------

Old:
----
  iperf-3.1.tar.gz

New:
----
  iperf-3.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ iperf.spec ++++++
--- /var/tmp/diff_new_pack.EzWFSN/_old  2016-02-11 12:37:43.000000000 +0100
+++ /var/tmp/diff_new_pack.EzWFSN/_new  2016-02-11 12:37:43.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package iperf
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,13 +18,14 @@
 
 %define soname  0
 Name:           iperf
-Version:        3.1
+Version:        3.1.2
 Release:        0
 Summary:        A tool to measure network performance
 License:        BSD-3-Clause
 Group:          Productivity/Networking/Diagnostic
 Url:            http://software.es.net/iperf/
-Source:         http://downloads.es.net/pub/iperf/%{name}-%{version}.tar.gz
+#Source URL:    http://downloads.es.net/pub/iperf/%{name}-%{version}.tar.gz
+Source:         %{name}-%{version}.tar.gz
 # PATCH-FIX-OPENSUSE -- Disable profiling if %%optflags includes 
-fomit-frame-pointer, as option -pg conflicts with it
 Patch1:         iperf-disable-profiling.patch
 %if %{?sles_version} && %{?sles_version} <= 11

++++++ iperf-3.1.tar.gz -> iperf-3.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/LICENSE new/iperf-3.1.2/LICENSE
--- old/iperf-3.1/LICENSE       2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/LICENSE     2016-02-02 00:48:54.000000000 +0100
@@ -1,6 +1,6 @@
-"iperf, Copyright (c) 2014, The Regents of the University of California, 
through
-Lawrence Berkeley National Laboratory (subject to receipt of any required
-approvals from the U.S. Dept. of Energy).  All rights reserved."
+"iperf, Copyright (c) 2014-2016, The Regents of the University of California,
+through Lawrence Berkeley National Laboratory (subject to receipt of any 
+required approvals from the U.S. Dept. of Energy).  All rights reserved."
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/README.md new/iperf-3.1.2/README.md
--- old/iperf-3.1/README.md     2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/README.md   2016-02-02 00:48:54.000000000 +0100
@@ -26,6 +26,13 @@
 iperf3 is principally developed by ESnet / Lawrence Berkeley National
 Laboratory.  It is released under a three-clause BSD license.
 
+Note that at this point, ESnet plans to support iperf3 in "maintenance
+mode".  At this point, there are no definite plans for further iperf3
+releases, and ESnet will be providing a very limited amount of
+resources for support and development, going forward.  However, ESnet
+could issue new iperf3 releases to deal with security issues or
+high-impact bug fixes.
+
 For more information see: http://software.es.net/iperf
 
 Source code and issue tracker: https://github.com/esnet/iperf
@@ -149,15 +156,29 @@
 * The -Z flag sometimes causes the iperf3 client to hang on OSX.
 (Issue #129)
 
-* When specifying the TCP buffer size using the "-w" flag on Linux, Linux 
+* When specifying the socket buffer size using the "-w" flag on Linux, Linux 
 doubles the value you pass in. (You can see this using iperf3's debug flag). 
 But then the CWND does not actually ramp up to the doubled value, but only
 to about 75% of the doubled value. This appears to be by design.
 
+* Although the "-w" flag is documented as setting the (TCP) window
+size, it is also used to set the socket buffer size.  This has been
+shown to be helpful with high-bitrate UDP tests.
+
 * On some platforms, it might be necessary to invoke "ldconfig" 
 manually after doing a "make install" before the iperf3 executable can 
 find its shared library.  (Issue #153)
 
+* The results printed on the server side at the end of a test do not
+correctly reflect the client-side measurements.  This is due to the
+ordering of computing and transferring results between the client
+and server.  (Issue #293)
+
+* The server could have a very short measurement reporting interval at
+the end of a test (particularly a UDP test), containing few or no
+packets.  This issue is due to an artifact of timing between the
+client and server.  (Issue #278)
+
 Links
 -----
 
@@ -173,7 +194,7 @@
 Copyright
 ---------
 
-iperf, Copyright (c) 2014, The Regents of the University of
+iperf, Copyright (c) 2014-2016, The Regents of the University of
 California, through Lawrence Berkeley National Laboratory (subject
 to receipt of any required approvals from the U.S. Dept. of
 Energy).  All rights reserved.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/RELEASE_NOTES new/iperf-3.1.2/RELEASE_NOTES
--- old/iperf-3.1/RELEASE_NOTES 2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/RELEASE_NOTES       2016-02-02 00:48:54.000000000 +0100
@@ -1,3 +1,42 @@
+== iperf 3.1.2 2016-02-01 ==
+
+The release notes for iperf 3.1.2 describe changes, including bug
+fixes and new functionality, made since iperf 3.1.1.
+
+* User-visible changes
+
+  * Fixed a bug that caused nan values to be emitted (incorrectly)
+    into JSON, particularly at the end of UDP tests (issue #278).
+
+  * Fixed a bug that caused the wrong value to be printed for
+    out-of-order UDP packets (issue #329).
+
+  * Added a contrib/ directory containing a few submitted graphing
+    scripts.
+
+* Developer-visible changes
+
+== iperf 3.1.1 2015-11-19 ==
+
+The release notes for iperf 3.1.1 describe changes and new
+functionality in iperf 3.1.1, but not present in 3.1.
+
+* User-visible changes
+
+  * Some markup fixes have been made in the manpages for Debian
+    compatibility (issue #291).
+
+  * A bug where the -T title option was not being output correctly
+    in JSON output has been fixed (issue #292).
+
+  * Argument handling for some command-line options has been improved
+    (issue #316).
+
+* Developer-visible changes
+
+  * A regression with C++ compatibility in one of the iperf header
+    files has been fixed (issue #323).
+
 == iperf 3.1 2015-10-16 ==
 
 The release notes for iperf 3.1 describe changes and new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/config/ltmain.sh 
new/iperf-3.1.2/config/ltmain.sh
--- old/iperf-3.1/config/ltmain.sh      2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/config/ltmain.sh    2016-02-02 00:48:54.000000000 +0100
@@ -7273,9 +7273,11 @@
       # --sysroot=*          for sysroot support
       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
       # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+      
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -fsanitize=*)
         func_quote_for_eval "$arg"
        arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/configure new/iperf-3.1.2/configure
--- old/iperf-3.1/configure     2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/configure   2016-02-02 00:48:54.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for iperf 3.1.
+# Generated by GNU Autoconf 2.69 for iperf 3.1.2.
 #
 # Report bugs to <https://github.com/esnet/iperf>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='iperf'
 PACKAGE_TARNAME='iperf'
-PACKAGE_VERSION='3.1'
-PACKAGE_STRING='iperf 3.1'
+PACKAGE_VERSION='3.1.2'
+PACKAGE_STRING='iperf 3.1.2'
 PACKAGE_BUGREPORT='https://github.com/esnet/iperf'
 PACKAGE_URL='http://software.es.net/iperf/'
 
@@ -1316,7 +1316,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures iperf 3.1 to adapt to many kinds of systems.
+\`configure' configures iperf 3.1.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1386,7 +1386,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of iperf 3.1:";;
+     short | recursive ) echo "Configuration of iperf 3.1.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1500,7 +1500,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-iperf configure 3.1
+iperf configure 3.1.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1869,7 +1869,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by iperf $as_me 3.1, which was
+It was created by iperf $as_me 3.1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2744,7 +2744,7 @@
 
 # Define the identity of the package.
  PACKAGE='iperf'
- VERSION='3.1'
+ VERSION='3.1.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13309,7 +13309,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by iperf $as_me 3.1, which was
+This file was extended by iperf $as_me 3.1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13376,7 +13376,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-iperf config.status 3.1
+iperf config.status 3.1.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/configure.ac new/iperf-3.1.2/configure.ac
--- old/iperf-3.1/configure.ac  2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/configure.ac        2016-02-02 00:48:54.000000000 +0100
@@ -24,7 +24,7 @@
 # file for complete information.
 
 # Initialize the autoconf system for the specified tool, version and mailing 
list
-AC_INIT(iperf, 3.1, https://github.com/esnet/iperf, iperf, 
http://software.es.net/iperf/)
+AC_INIT(iperf, 3.1.2, https://github.com/esnet/iperf, iperf, 
http://software.es.net/iperf/)
 AC_LANG(C)
 
 # Specify where the auxiliary files created by configure should go. The config
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/contrib/README.txt 
new/iperf-3.1.2/contrib/README.txt
--- old/iperf-3.1/contrib/README.txt    1970-01-01 01:00:00.000000000 +0100
+++ new/iperf-3.1.2/contrib/README.txt  2016-02-02 00:48:54.000000000 +0100
@@ -0,0 +1,12 @@
+
+This directory contains files that might be useful to analyze iperf3 results
+
+iperf3_to_gnuplot.py: converts iperf3 JSON output to format easy to plot in 
gnuplot
+
+iperf3.gp: sample gnuplot commands to plot throught and retransmits
+
+
+Other iperf3 related projects that might be of interest:
+
+https://github.com/kaihendry/iperf3chart
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/contrib/iperf3.gp 
new/iperf-3.1.2/contrib/iperf3.gp
--- old/iperf-3.1/contrib/iperf3.gp     1970-01-01 01:00:00.000000000 +0100
+++ new/iperf-3.1.2/contrib/iperf3.gp   2016-02-02 00:48:54.000000000 +0100
@@ -0,0 +1,37 @@
+#
+# sample Gnuplot command file for iperf3 results
+set term x11
+#set term png 
+#set term postscript landscape color
+set key width -12
+
+# iperf3 data fields
+#start bytes bits_per_second retransmits snd_cwnd
+
+set output "iperf3.png"
+#set output "iperf3.eps"
+
+#set nokey
+
+set grid xtics
+set grid ytics
+set grid linewidth 1
+set title "TCP performance: 40G to 10G host"
+set xlabel "time (seconds)"
+set ylabel "Bandwidth (Gbits/second)"
+set xrange [0:60] 
+set yrange [0:15] 
+set ytics nomirror
+set y2tics
+set y2range [0:2500] 
+# dont plot when retransmits = 0
+set datafile missing '0'
+set pointsize 1.6
+
+plot "40Gto10G.old.dat" using 1:3 title '3.10 kernel' with linespoints lw 3 pt 
5, \
+        "40Gto10G.new.dat" using 1:3 title '4.2 kernel' with linespoints lw 3 
pt 7, \
+        "40Gto10G.old.dat" using 1:4 title 'retransmits' with points pt 7 axes 
x1y2
+
+#plot "iperf3.old.dat" using 1:3 title '3.10 kernel' with linespoints lw 3 pt 
5, \
+#       "iperf3.new.dat" using 1:3 title '4.2 kernel' with linespoints lw 3 pt 
7
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/contrib/iperf3_to_gnuplot.py 
new/iperf-3.1.2/contrib/iperf3_to_gnuplot.py
--- old/iperf-3.1/contrib/iperf3_to_gnuplot.py  1970-01-01 01:00:00.000000000 
+0100
+++ new/iperf-3.1.2/contrib/iperf3_to_gnuplot.py        2016-02-02 
00:48:54.000000000 +0100
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+
+"""
+Extract iperf data from json blob and format for gnuplot.
+"""
+
+import json
+import os
+import sys
+
+import os.path
+from optparse import OptionParser
+
+import pprint
+# for debugging, so output to stderr to keep verbose
+# output out of any redirected stdout.
+pp = pprint.PrettyPrinter(indent=4, stream=sys.stderr)
+
+def generate_output(iperf, options):
+    for i in iperf.get('intervals'):
+        for ii in i.get('streams'):
+            if options.verbose: pp.pprint(ii)
+            row = '{0} {1} {2} {3} {4}\n'.format(
+                        round(float(ii.get('start')), 4),
+                        ii.get('bytes'),
+                        # to Gbits/sec
+                        round(float(ii.get('bits_per_second')) / 
(1000*1000*1000), 3),
+                        ii.get('retransmits'),
+                        round(float(ii.get('snd_cwnd')) / (1000*1000), 2)
+                    )
+            yield row
+
+def main():
+    usage = '%prog [ -f FILE | -o OUT | -v ]'
+    parser = OptionParser(usage=usage)
+    parser.add_option('-f', '--file', metavar='FILE',
+        type='string', dest='filename', 
+        help='Input filename.')
+    parser.add_option('-o', '--output', metavar='OUT',
+            type='string', dest='output', 
+            help='Optional file to append output to.')
+    parser.add_option('-v', '--verbose',
+        dest='verbose', action='store_true', default=False,
+        help='Verbose debug output to stderr.')
+    options, args = parser.parse_args()
+    
+    if not options.filename:
+        parser.error('Filename is required.')
+    
+    file_path = os.path.normpath(options.filename)
+    
+    if not os.path.exists(file_path):
+        parser.error('{f} does not exist'.format(f=file_path))
+
+    with open(file_path,'r') as fh:
+        data = fh.read()
+    
+    try:
+        iperf = json.loads(data)
+    except Exception as e:
+        parser.error('Could not parse JSON from file (ex): {0}'.format(str(e)))
+
+    if options.output:
+        absp = os.path.abspath(options.output)
+        d,f = os.path.split(absp)
+        if not os.path.exists(d):
+            parser.error('Output file directory path {0} does not 
exist'.format(d))
+        fh = open(absp, 'a')
+    else:
+        fh = sys.stdout
+
+    for i in generate_output(iperf, options):
+        fh.write(i)
+
+
+if __name__ == '__main__':
+    main()
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/iperf.h new/iperf-3.1.2/src/iperf.h
--- old/iperf-3.1/src/iperf.h   2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/iperf.h 2016-02-02 00:48:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * iperf, Copyright (c) 2014, The Regents of the University of
+ * iperf, Copyright (c) 2014, 2015, The Regents of the University of
  * California, through Lawrence Berkeley National Laboratory (subject
  * to receipt of any required approvals from the U.S. Dept. of
  * Energy).  All rights reserved.
@@ -202,7 +202,7 @@
     struct protocol *protocol;
     signed char state;
     char     *server_hostname;                  /* -c option */
-    char     *template;                         /* -c option */
+    char     *tmp_template;
     char     *bind_address;                     /* first -B option */
     TAILQ_HEAD(xbind_addrhead, xbind_entry) xbind_addrs; /* all -X opts */
     int       bind_port;                        /* --cport option */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/iperf3.1 new/iperf-3.1.2/src/iperf3.1
--- old/iperf-3.1/src/iperf3.1  2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/iperf3.1        2016-02-02 00:48:54.000000000 +0100
@@ -95,7 +95,7 @@
 .TP
 .BR -b ", " --bandwidth " \fIn\fR[KM]"
 set target bandwidth to \fIn\fR bits/sec (default 1 Mbit/sec for UDP, 
unlimited for TCP).
-If there are multiple streams (-P flag), the bandwidth limit is applied
+If there are multiple streams (\-P flag), the bandwidth limit is applied
 separately to each stream.
 You can also add a '/' and a number to the bandwidth specifier.
 This is called "burst mode".
@@ -108,10 +108,10 @@
 time in seconds to transmit for (default 10 secs)
 .TP
 .BR -n ", " --bytes " \fIn\fR[KM]"
-number of bytes to transmit (instead of -t)
+number of bytes to transmit (instead of \-t)
 .TP
 .BR -k ", " --blockcount " \fIn\fR[KM]"
-number of blocks (packets) to transmit (instead of -t or -n)
+number of blocks (packets) to transmit (instead of \-t or \-n)
 .TP
 .BR -l ", " --length " \fIn\fR[KM]"
 length of buffer to read or write (default 128 KB for TCP, 8KB for UDP)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/iperf_api.c 
new/iperf-3.1.2/src/iperf_api.c
--- old/iperf-3.1/src/iperf_api.c       2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/iperf_api.c     2016-02-02 00:48:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * iperf, Copyright (c) 2014, 2015, The Regents of the University of
+ * iperf, Copyright (c) 2014, 2015, 2016, The Regents of the University of
  * California, through Lawrence Berkeley National Laboratory (subject
  * to receipt of any required approvals from the U.S. Dept. of
  * Energy).  All rights reserved.
@@ -213,7 +213,7 @@
 char*
 iperf_get_test_template(struct iperf_test *ipt)
 {
-    return ipt->template;
+    return ipt->tmp_template;
 }
 
 int
@@ -379,9 +379,9 @@
 }
 
 void
-iperf_set_test_template(struct iperf_test *ipt, char *template)
+iperf_set_test_template(struct iperf_test *ipt, char *tmp_template)
 {
-    ipt->template = strdup(template);
+    ipt->tmp_template = strdup(tmp_template);
 }
 
 void
@@ -662,6 +662,7 @@
     int flag;
     int blksize;
     int server_flag, client_flag, rate_flag, duration_flag;
+    char *endptr;
 #if defined(HAVE_CPU_AFFINITY)
     char* comma;
 #endif /* HAVE_CPU_AFFINITY */
@@ -825,13 +826,20 @@
                 test->settings->domain = AF_INET6;
                 break;
             case 'S':
-                test->settings->tos = strtol(optarg, NULL, 0);
+                test->settings->tos = strtol(optarg, &endptr, 0);
+               if (endptr == optarg ||
+                   test->settings->tos < 0 ||
+                   test->settings->tos > 255) {
+                   i_errno = IEBADTOS;
+                   return -1;
+               }
                client_flag = 1;
                 break;
             case 'L':
 #if defined(HAVE_FLOWLABEL)
-                test->settings->flowlabel = strtol(optarg, NULL, 0);
-               if (test->settings->flowlabel < 1 || test->settings->flowlabel 
> 0xfffff) {
+                test->settings->flowlabel = strtol(optarg, &endptr, 0);
+               if (endptr == optarg ||
+                   test->settings->flowlabel < 1 || test->settings->flowlabel 
> 0xfffff) {
                     i_errno = IESETFLOW;
                     return -1;
                }
@@ -876,8 +884,9 @@
                 break;
             case 'A':
 #if defined(HAVE_CPU_AFFINITY)
-                test->affinity = atoi(optarg);
-                if (test->affinity < 0 || test->affinity > 1024) {
+                test->affinity = strtol(optarg, &endptr, 0);
+                if (endptr == optarg || 
+                   test->affinity < 0 || test->affinity > 1024) {
                     i_errno = IEAFFINITY;
                     return -1;
                 }
@@ -1881,8 +1890,8 @@
 
     if (test->server_hostname)
        free(test->server_hostname);
-    if (test->template)
-    free(test->template);
+    if (test->tmp_template)
+       free(test->tmp_template);
     if (test->bind_address)
        free(test->bind_address);
     if (!TAILQ_EMPTY(&test->xbind_addrs)) {
@@ -2234,7 +2243,12 @@
                    iprintf(test, report_sum_bw_udp_sender_format, start_time, 
end_time, ubuf, nbuf, total_packets, test->omitting?report_omitted:"");
            } else {
                avg_jitter /= test->num_streams;
-               lost_percent = 100.0 * lost_packets / total_packets;
+               if (total_packets > 0) {
+                   lost_percent = 100.0 * lost_packets / total_packets;
+               }
+               else {
+                   lost_percent = 0.0;
+               }
                if (test->json_output)
                    cJSON_AddItemToObject(json_interval, "sum", 
iperf_json_printf("start: %f  end: %f  seconds: %f  bytes: %d  bits_per_second: 
%f  jitter_ms: %f  lost_packets: %d  packets: %d  lost_percent: %f  omitted: 
%b", (double) start_time, (double) end_time, (double) irp->interval_duration, 
(int64_t) bytes, bandwidth * 8, (double) avg_jitter * 1000.0, (int64_t) 
lost_packets, (int64_t) total_packets, (double) lost_percent, test->omitting));
                else
@@ -2338,15 +2352,20 @@
            }
        } else {
            /* Summary, UDP. */
-           lost_percent = 100.0 * sp->cnt_error / (sp->packet_count - 
sp->omitted_packet_count);
+           if (sp->packet_count - sp->omitted_packet_count > 0) {
+               lost_percent = 100.0 * sp->cnt_error / (sp->packet_count - 
sp->omitted_packet_count);
+           }
+           else {
+               lost_percent = 0.0;
+           }
            if (test->json_output)
-               cJSON_AddItemToObject(json_summary_stream, "udp", 
iperf_json_printf("socket: %d  start: %f  end: %f  seconds: %f  bytes: %d  
bits_per_second: %f  jitter_ms: %f  lost_packets: %d  packets: %d  
lost_percent: %f", (int64_t) sp->socket, (double) start_time, (double) 
end_time, (double) end_time, (int64_t) bytes_sent, bandwidth * 8, (double) 
sp->jitter * 1000.0, (int64_t) sp->cnt_error, (int64_t) (sp->packet_count - 
sp->omitted_packet_count), (double) lost_percent));
+               cJSON_AddItemToObject(json_summary_stream, "udp", 
iperf_json_printf("socket: %d  start: %f  end: %f  seconds: %f  bytes: %d  
bits_per_second: %f  jitter_ms: %f  lost_packets: %d  packets: %d  
lost_percent: %f  out_of_order: %d", (int64_t) sp->socket, (double) start_time, 
(double) end_time, (double) end_time, (int64_t) bytes_sent, bandwidth * 8, 
(double) sp->jitter * 1000.0, (int64_t) sp->cnt_error, (int64_t) 
(sp->packet_count - sp->omitted_packet_count), (double) lost_percent, (int64_t) 
sp->outoforder_packets));
            else {
                iprintf(test, report_bw_udp_format, sp->socket, start_time, 
end_time, ubuf, nbuf, sp->jitter * 1000.0, sp->cnt_error, (sp->packet_count - 
sp->omitted_packet_count), lost_percent, "");
                if (test->role == 'c')
                    iprintf(test, report_datagrams, sp->socket, 
(sp->packet_count - sp->omitted_packet_count));
                if (sp->outoforder_packets > 0)
-                   iprintf(test, report_sum_outoforder, start_time, end_time, 
sp->cnt_error);
+                   iprintf(test, report_sum_outoforder, start_time, end_time, 
sp->outoforder_packets);
            }
        }
 
@@ -2413,12 +2432,12 @@
         } else {
            /* Summary sum, UDP. */
             avg_jitter /= test->num_streams;
-           /* If no packets were sent, arbitrarily set loss percentage to 100. 
*/
+           /* If no packets were sent, arbitrarily set loss percentage to 0. */
            if (total_packets > 0) {
                lost_percent = 100.0 * lost_packets / total_packets;
            }
            else {
-               lost_percent = 100.0;
+               lost_percent = 0.0;
            }
            if (test->json_output)
                cJSON_AddItemToObject(test->json_end, "sum", 
iperf_json_printf("start: %f  end: %f  seconds: %f  bytes: %d  bits_per_second: 
%f  jitter_ms: %f  lost_packets: %d  packets: %d  lost_percent: %f", (double) 
start_time, (double) end_time, (double) end_time, (int64_t) total_sent, 
bandwidth * 8, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) 
total_packets, (double) lost_percent));
@@ -2550,7 +2569,12 @@
            else
                iprintf(test, report_bw_udp_sender_format, sp->socket, st, et, 
ubuf, nbuf, irp->interval_packet_count, irp->omitted?report_omitted:"");
        } else {
-           lost_percent = 100.0 * irp->interval_cnt_error / 
irp->interval_packet_count;
+           if (irp->interval_packet_count > 0) {
+               lost_percent = 100.0 * irp->interval_cnt_error / 
irp->interval_packet_count;
+           }
+           else {
+               lost_percent = 0.0;
+           }
            if (test->json_output)
                cJSON_AddItemToArray(json_interval_streams, 
iperf_json_printf("socket: %d  start: %f  end: %f  seconds: %f  bytes: %d  
bits_per_second: %f  jitter_ms: %f  lost_packets: %d  packets: %d  
lost_percent: %f  omitted: %b", (int64_t) sp->socket, (double) st, (double) et, 
(double) irp->interval_duration, (int64_t) irp->bytes_transferred, bandwidth * 
8, (double) irp->jitter * 1000.0, (int64_t) irp->interval_cnt_error, (int64_t) 
irp->interval_packet_count, (double) lost_percent, irp->omitted));
            else
@@ -2591,8 +2615,8 @@
     struct iperf_stream *sp;
     
     char template[1024];
-    if (test->template) {
-        snprintf(template, sizeof(template) / sizeof(char), "%s", 
test->template);
+    if (test->tmp_template) {
+        snprintf(template, sizeof(template) / sizeof(char), "%s", 
test->tmp_template);
     } else {
         char buf[] = "/tmp/iperf3.XXXXXX";
         snprintf(template, sizeof(template) / sizeof(char), "%s", buf);
@@ -2865,8 +2889,6 @@
     test->json_top = cJSON_CreateObject();
     if (test->json_top == NULL)
         return -1;
-    if (test->title)
-       cJSON_AddStringToObject(test->json_top, "title", test->title);
     test->json_start = cJSON_CreateObject();
     if (test->json_start == NULL)
         return -1;
@@ -2889,6 +2911,8 @@
 int
 iperf_json_finish(struct iperf_test *test)
 {
+    if (test->title)
+       cJSON_AddStringToObject(test->json_top, "title", test->title);
     /* Include server output */
     if (test->json_server_output) {
        cJSON_AddItemToObject(test->json_top, "server_output_json", 
test->json_server_output);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/iperf_api.h 
new/iperf-3.1.2/src/iperf_api.h
--- old/iperf-3.1/src/iperf_api.h       2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/iperf_api.h     2016-02-02 00:48:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * iperf, Copyright (c) 2014, The Regents of the University of
+ * iperf, Copyright (c) 2014, 2015, The Regents of the University of
  * California, through Lawrence Berkeley National Laboratory (subject
  * to receipt of any required approvals from the U.S. Dept. of
  * Energy).  All rights reserved.
@@ -114,7 +114,7 @@
 void   iperf_set_test_num_streams( struct iperf_test* ipt, int num_streams );
 void   iperf_set_test_role( struct iperf_test* ipt, char role );
 void   iperf_set_test_server_hostname( struct iperf_test* ipt, char* 
server_hostname );
-void    iperf_set_test_template( struct iperf_test *ipt, char *template );
+void    iperf_set_test_template( struct iperf_test *ipt, char *tmp_template );
 void   iperf_set_test_reverse( struct iperf_test* ipt, int reverse );
 void   iperf_set_test_json_output( struct iperf_test* ipt, int json_output );
 int    iperf_has_zerocopy( void );
@@ -289,6 +289,7 @@
     IENOSCTP = 18,         // No SCTP support available
     IEBIND = 19,                       // Local port specified with no local 
bind option
     IEUDPBLOCKSIZE = 20,    // Block size too large. Maximum value = 
%dMAX_UDP_BLOCKSIZE
+    IEBADTOS = 21,         // Bad TOS value
     /* Test errors */
     IENEWTEST = 100,        // Unable to create a new test (check perror)
     IEINITTEST = 101,       // Test initialization failed (check perror)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/iperf_error.c 
new/iperf-3.1.2/src/iperf_error.c
--- old/iperf-3.1/src/iperf_error.c     2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/iperf_error.c   2016-02-02 00:48:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * iperf, Copyright (c) 2014, The Regents of the University of
+ * iperf, Copyright (c) 2014, 2015, The Regents of the University of
  * California, through Lawrence Berkeley National Laboratory (subject
  * to receipt of any required approvals from the U.S. Dept. of
  * Energy).  All rights reserved.
@@ -127,6 +127,9 @@
         case IEUDPBLOCKSIZE:
             snprintf(errstr, len, "block size too large (maximum = %d bytes)", 
MAX_UDP_BLOCKSIZE);
             break;
+       case IEBADTOS:
+           snprintf(errstr, len, "bad TOS value (must be between 0 and 255 
inclusive)");
+           break;
         case IEMSS:
             snprintf(errstr, len, "TCP MSS too large (maximum = %d bytes)", 
MAX_MSS);
             break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/libiperf.3 
new/iperf-3.1.2/src/libiperf.3
--- old/iperf-3.1/src/libiperf.3        2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/libiperf.3      2016-02-02 00:48:54.000000000 +0100
@@ -5,7 +5,7 @@
 .SH SYNOPSIS
 #include <iperf_api.h>
 .br
--liperf
+\-liperf
 
 .SH DESCRIPTION
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iperf-3.1/src/main.c new/iperf-3.1.2/src/main.c
--- old/iperf-3.1/src/main.c    2015-10-16 19:01:09.000000000 +0200
+++ new/iperf-3.1.2/src/main.c  2016-02-02 00:48:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * iperf, Copyright (c) 2014, The Regents of the University of
+ * iperf, Copyright (c) 2014, 2015, The Regents of the University of
  * California, through Lawrence Berkeley National Laboratory (subject
  * to receipt of any required approvals from the U.S. Dept. of
  * Energy).  All rights reserved.
@@ -153,10 +153,9 @@
             for (;;) {
                if (iperf_run_server(test) < 0) {
                    iperf_err(test, "error - %s", iperf_strerror(i_errno));
-                    fprintf(stderr, "\n");
                    ++consecutive_errors;
                    if (consecutive_errors >= 5) {
-                       fprintf(stderr, "too many errors, exiting\n");
+                       iperf_errexit(test, "too many errors, exiting");
                        break;
                    }
                 } else


Reply via email to