From patchwork Thu Jul 12 14:58:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander 'lynxis' Couzens X-Patchwork-Id: 943074 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=fe80.eu Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KO7TuoEv"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="nSJmB8CA"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41RJx0251lz9s2x for ; Fri, 13 Jul 2018 00:58:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pEMIYRJ/FTaQUm49Y8cItZkydf+EAQW1MHWhVAvuuto=; b=KO7TuoEvqhY1lR Yob5LSNnxJ7MusRGUqAR3AQb4oGgtVWOVhcXBVpBYUkfaX+vLDEDbPu9aKsgVemHyr3wxcaZlOO1G bWZWXXWWpWHQM9rC80BtZxrtgqGjyli3yrQdRg0O6E/SiA1nEG//iD3o+rf5u7t0lf1n998067/wj C97tZMWp2ujd/PQbThoJJDY1KXbVxaXoXgdbHOqQWcwHZQVQ6Av+N/qQtvAI/lle3WkOfYhPsGzel oyg2Q5GHnmmRsR/LFfyo2N9iRJEYJJFmTXTXbM+X3axEcPlTvak7+TG2X6O0PX1hh8rJCKswRM/92 FD8Peq3JzXf8eXbxKsew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdd3Y-0002hK-85; Thu, 12 Jul 2018 14:58:56 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdd3W-0002fw-2m for openwrt-devel@bombadil.infradead.org; Thu, 12 Jul 2018 14:58:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WHxsQTEXQR7PLWZPMlem5+Z0/GfAgYjzEgquHUFuDMc=; b=nSJmB8CA64bCiZqXrR4WruJR7 Ub7SamsSX052Y60iaSI/lHMI51ZNvWHm/Ae+wTX0uZL5sG+o5SmpDxu7bkHbZuOHyJ8UbVVpOy25p 2EOsA6bvDSu75vSPVOAJMVo7fR8S5ryOoo2fHEJsJ8ZTdzqQLahfiv5UO5YTaMg1E3DuB5QI9xeHl d6xNt96tQ+IB2z5VUdwMPPjVSfLShvYIfGYqBGDvgyAsWRUqu61wg76ejPZ3+0cZAF7Hzbm3b3fjW TKdWqXwIcdVK7uRQcqD4loFAmiBgvuAW8q+SxytrDwl4xCSVwcg3YHqodJPS4VEc7Xk1AYimMMK6U IoGgbBg9w==; Received: from mail.base45.de ([2001:67c:2050:320::77]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdd3S-00037l-W5 for openwrt-devel@lists.openwrt.org; Thu, 12 Jul 2018 14:58:52 +0000 Received: from [2a02:8109:8e40:32b4:e5c2:7f3b:7544:dd37] (helo=lazus.fritz.box) by mail.base45.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fdd3E-00019s-TH; Thu, 12 Jul 2018 14:58:36 +0000 From: Alexander Couzens To: Felix Fietkau Date: Thu, 12 Jul 2018 16:58:00 +0200 Message-Id: <20180712145800.29304-1-lynxis@fe80.eu> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180712_155851_065450_D3BEDAAD X-CRM114-Status: GOOD ( 12.08 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH] package/iperf: fix build for non-ipv6 builds X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, Alexander Couzens MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alexander Couzens --- package/network/utils/iperf/Makefile | 6 +++- .../patches/0001-fix-non-ipv6-builds.patch | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/iperf/patches/0001-fix-non-ipv6-builds.patch diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index 606ba218def7..dd9ade95bf3f 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf PKG_VERSION:=2.0.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_HASH:=b7d650d07c6bb0e357b5938a20e4ac33876012fddb952299c5d321e6958da5d2 @@ -40,6 +40,10 @@ endef TARGET_CFLAGS += -D_GNU_SOURCE CONFIGURE_ARGS += --disable-multicast +ifeq ($(CONFIG_IPV6),) + CONFIGURE_ARGS += --disable-ipv6 +endif + CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti" CONFIGURE_VARS += LIBS="-lpthread -lm" diff --git a/package/network/utils/iperf/patches/0001-fix-non-ipv6-builds.patch b/package/network/utils/iperf/patches/0001-fix-non-ipv6-builds.patch new file mode 100644 index 000000000000..a6a51570f48e --- /dev/null +++ b/package/network/utils/iperf/patches/0001-fix-non-ipv6-builds.patch @@ -0,0 +1,36 @@ +Index: iperf-2.0.11/src/Listener.cpp +=================================================================== +--- iperf-2.0.11.orig/src/Listener.cpp ++++ iperf-2.0.11/src/Listener.cpp +@@ -670,6 +670,7 @@ int Listener::L2_setup (void) { + + // Now optimize packet flow up the raw socket + // Establish the flow BPF to forward up only "connected" packets to this raw socket ++#ifdef HAVE_IPV6 + if (l->sa_family == AF_INET6) { + struct in6_addr *v6peer = SockAddr_get_in6_addr(&server->peer); + struct in6_addr *v6local = SockAddr_get_in6_addr(&server->local); +@@ -682,6 +683,9 @@ int Listener::L2_setup (void) { + WARN_errno( rc == SOCKET_ERROR, "l2 v4in6 connect ip bpf"); + } + } else { ++#else ++ { ++#endif + rc = SockAddr_v4_Connect_BPF(server->mSock, ((struct sockaddr_in *)(l))->sin_addr.s_addr, ((struct sockaddr_in *)(p))->sin_addr.s_addr, ((struct sockaddr_in *)(l))->sin_port, ((struct sockaddr_in *)(p))->sin_port); + WARN_errno( rc == SOCKET_ERROR, "l2 connect ip bpf"); + } +Index: iperf-2.0.11/src/SocketAddr.c +=================================================================== +--- iperf-2.0.11.orig/src/SocketAddr.c ++++ iperf-2.0.11/src/SocketAddr.c +@@ -317,7 +317,8 @@ void SockAddr_setAddressAny( iperf_socka + * ------------------------------------------------------------------- */ + + void SockAddr_incrAddress( iperf_sockaddr *inSockAddr, int value ) { +- if (inSockAddr->ss_family == AF_INET) ++ struct sockaddr_storage *storage = inSockAddr; ++ if (storage->ss_family == AF_INET) + ((struct sockaddr_in *)inSockAddr)->sin_addr.s_addr += htonl(value); + #if defined(HAVE_IPV6) + else {