[LEDE-DEV] [PATCH 1/2] iperf: Upgrade to version 2.0.8

2016-05-10 Thread Bert Vermeulen
The original iperf package is unmaintained. This switches to the "iperf2"
project on sourceforge, a fork that started where the previous iperf left
off.

Version 2.0.8 fixes the issue that patch 002 handled, so that can be dropped.

Due to a faulty check in configure.ac, this version needs _GNU_SOURCE
defined to build properly against musl. Various other obsolete build
options were also removed.

Signed-off-by: Bert Vermeulen <b...@biot.com>
---
 package/network/utils/iperf/Makefile   | 13 ++-
 .../utils/iperf/patches/002-format-security.patch  | 96 --
 2 files changed, 5 insertions(+), 104 deletions(-)
 delete mode 100644 
package/network/utils/iperf/patches/002-format-security.patch

diff --git a/package/network/utils/iperf/Makefile 
b/package/network/utils/iperf/Makefile
index a3e0232..0085d34 100644
--- a/package/network/utils/iperf/Makefile
+++ b/package/network/utils/iperf/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iperf
-PKG_VERSION:=2.0.5
+PKG_VERSION:=2.0.8
 PKG_RELEASE:=1
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=44b5536b67719f4250faed632a3cd016
+PKG_SOURCE_URL:=@SF/iperf2
+PKG_MD5SUM:=e5887f799d8dc64a974c6c2f2e5cc339
 
 PKG_MAINTAINER:=Felix Fietkau <n...@openwrt.org>
 PKG_LICENSE:=BSD-3-Clause
@@ -29,7 +29,7 @@ define Package/iperf/Default
   CATEGORY:=Network
   DEPENDS:= $(CXX_DEPENDS)
   TITLE:=Internet Protocol bandwidth measuring tool
-  URL:=http://sourceforge.net/projects/iperf/
+  URL:=http://sourceforge.net/projects/iperf2/
 endef
 
 define Package/iperf/Default/description
@@ -61,14 +61,11 @@ $(call Package/iperf/Default/description)
  This package is built with multithread support.
 endef
 
+TARGET_CFLAGS += -D_GNU_SOURCE
 CONFIGURE_ARGS += --disable-multicast
-CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes
 
 ifeq ($(BUILD_VARIANT),single)
   CONFIGURE_ARGS += --disable-threads
-else
-  CONFIGURE_ARGS += --enable-threads=posix
-  CONFIGURE_VARS += ac_cv_func_pthread_cancel=no
 endif
 
 CONFIGURE_VARS += CXXFLAGS="CXXFLAGS -fno-rtti"
diff --git a/package/network/utils/iperf/patches/002-format-security.patch 
b/package/network/utils/iperf/patches/002-format-security.patch
deleted file mode 100644
index 9331e54..000
--- a/package/network/utils/iperf/patches/002-format-security.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-Description: iperf format string FTBFS with -Werror=format-security
- Reported by Didier Raboud <o...@debian.org>
-Author: Simon Paillard <spaill...@debian.org>
-Bug-Debian: http://bugs.debian.org/643408
-
 a/compat/Thread.c
-+++ b/compat/Thread.c
-@@ -381,7 +381,7 @@ int thread_release_nonterm( int interrup
- 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( _sNum_cond );
 a/src/ReportDefault.c
-+++ b/src/ReportDefault.c
-@@ -78,7 +78,7 @@ void reporter_printstats( Transfer_Info
- 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 @@ void reporter_printstats( Transfer_Info
- } 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 @@ void reporter_reportsettings( ReporterDa
-   (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 @@ void reporter_reportsettings( ReporterDa
- printf( warn_window_requested, buffer );
- }
- printf( "\n" );
--printf( separator_line );
-+printf( "%s", separator_line );
- }
- 
- /*
-@@ -286,7 +286,7 @@ void reporter_reportMSS( int inMSS, thre
- } else if ( checkMSS_MTU( inMSS, 576 ) ) {
- net = "minimum";
- mtu = 576;
--printf( warn_no_pathmtu );
-+printf( "%s", warn_no_pathmtu );
- } else {
-

[LEDE-DEV] [PATCH 2/2] iperf: Drop single-threaded variant

2016-05-10 Thread Bert Vermeulen
Signed-off-by: Bert Vermeulen <b...@biot.com>
---
 package/network/utils/iperf/Makefile   | 40 +++---
 ...et-report-next-time-in-single-thread-mode.patch | 14 
 2 files changed, 4 insertions(+), 50 deletions(-)
 delete mode 100644 
package/network/utils/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch

diff --git a/package/network/utils/iperf/Makefile 
b/package/network/utils/iperf/Makefile
index 0085d34..23832fa 100644
--- a/package/network/utils/iperf/Makefile
+++ b/package/network/utils/iperf/Makefile
@@ -24,61 +24,29 @@ PKG_BUILD_PARALLEL:=1
 include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
-define Package/iperf/Default
+define Package/iperf
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:= $(CXX_DEPENDS)
+  DEPENDS:= $(CXX_DEPENDS) +libpthread
   TITLE:=Internet Protocol bandwidth measuring tool
   URL:=http://sourceforge.net/projects/iperf2/
 endef
 
-define Package/iperf/Default/description
+define Package/iperf/description
  Iperf is a modern alternative for measuring TCP and UDP bandwidth
  performance, allowing the tuning of various parameters and
  characteristics.
 endef
 
-define Package/iperf
-$(call Package/iperf/Default)
-  TITLE+= (with single thread support)
-  VARIANT:=single
-endef
-
-define Package/iperf/description
-$(call Package/iperf/Default/description)
- This package is built with single thread support.
-endef
-
-define Package/iperf-mt
-$(call Package/iperf/Default)
-  DEPENDS+= +libpthread
-  TITLE+= (with multithread support)
-  VARIANT:=mt
-endef
-
-define Package/iperf-mt/description
-$(call Package/iperf/Default/description)
- This package is built with multithread support.
-endef
-
 TARGET_CFLAGS += -D_GNU_SOURCE
 CONFIGURE_ARGS += --disable-multicast
 
-ifeq ($(BUILD_VARIANT),single)
-  CONFIGURE_ARGS += --disable-threads
-endif
-
 CONFIGURE_VARS += CXXFLAGS="CXXFLAGS -fno-rtti"
-
-ifeq ($(BUILD_VARIANT),mt)
-  CONFIGURE_VARS += LIBS="-lpthread"
-endif
+CONFIGURE_VARS += LIBS="-lpthread"
 
 define Package/iperf/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf
 endef
-Package/iperf-mt/install = $(Package/iperf/install)
 
 $(eval $(call BuildPackage,iperf))
-$(eval $(call BuildPackage,iperf-mt))
diff --git 
a/package/network/utils/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch
 
b/package/network/utils/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch
deleted file mode 100644
index c61c754..000
--- 
a/package/network/utils/iperf/patches/001-set-report-next-time-in-single-thread-mode.patch
+++ /dev/null
@@ -1,14 +0,0 @@
 a/src/Reporter.c
-+++ b/src/Reporter.c
-@@ -308,6 +308,11 @@ ReportHeader* InitReport( thread_Setting
- #else
- // set start time
- gettimeofday( &(reporthdr->report.startTime), NULL );
-+
-+  // set next time
-+  reporthdr->report.nextTime = reporthdr->report.startTime;
-+  TimeAdd( reporthdr->report.nextTime, reporthdr->report.intervalTime );
-+
- /*
-  * Process the report in this thread
-  */
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] iftop: Update to latest version, and drop patch

2016-05-08 Thread Bert Vermeulen
On 05/07/2016 08:11 PM, Russell Senior wrote:
> In this particular case, as the author of the patch involved, I would
> suggest "if it isn't broken, don't fix it".  That is, iftop doesn't
> really need ncursesw, the patch lets it use plain ncurses even if
> ncursesw is available.  I don't see the problem leaving things like
> that.  It means carrying a small patch.  Seems like not that big a
> problem.

Carrying patches is of course a problem: as I showed with numbers, a
problem that won't solve itself and will get worse over time.

Upstreaming your patch must clearly be the first choice. Did you even
try to upstream an ncurses preference in iftop? It's been in the OpenWrt
repo for 3.5 YEARS!


-- 
Bert Vermeulen
b...@biot.com

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev