iperf: update to 2.2.1
authorWei-Ting Yang <[email protected]>
Wed, 20 Aug 2025 07:01:27 +0000 (15:01 +0800)
committerJosef Schlehofer <[email protected]>
Fri, 22 Aug 2025 13:13:12 +0000 (16:13 +0300)
Changelog: https://sourceforge.net/projects/iperf2/files/

Note: 001-checksums.c-needs-to-define-_GNU_SOURCE.patch is added to
fix a build error with musl libc, where struct udphdr members are not
available unless _GNU_SOURCE is defined.

Signed-off-by: Wei-Ting Yang <[email protected]>
net/iperf/Makefile
net/iperf/patches/001-checksums.c-needs-to-define-_GNU_SOURCE.patch [new file with mode: 0644]

index 88dcb06038e484572eb8f7145f2268732c1b167a..e5d4206212d321594961b6d4933ae61f33704673 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iperf
-PKG_VERSION:=2.1.9
+PKG_VERSION:=2.2.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=5c0771aab00ef14520013aef01675977816e23bb8f5d9fde016f90eb2f1be788
+PKG_HASH:=754ab0a7e28033dbea81308ef424bc7df4d6e2fe31b60cc536b61b51fefbd8fb
 PKG_SOURCE_URL:=@SF/iperf2
 
 PKG_MAINTAINER:=Felix Fietkau <[email protected]>
diff --git a/net/iperf/patches/001-checksums.c-needs-to-define-_GNU_SOURCE.patch b/net/iperf/patches/001-checksums.c-needs-to-define-_GNU_SOURCE.patch
new file mode 100644 (file)
index 0000000..910ad36
--- /dev/null
@@ -0,0 +1,43 @@
+From: Julien Olivain <[email protected]>
+Date: Mon, 11 Nov 2024 11:41:28 +0100
+Subject: [PATCH] checksums.c needs to define _GNU_SOURCE
+
+When compiling with musl libc [1], iperf2 fail to build with error:
+
+    checksums.c: In function 'udpchecksum':
+    checksums.c:175:17: error: 'const struct udphdr' has no member named 'check'
+      175 |     if (!udp_hdr->check) {
+          |                 ^~
+
+This failure was introduced in commit [2], in version 2.2.1. This is
+due to the switch from using <linux/udp.h> (which always define "struct
+udphdr" members), to <netinet/udp.h> which define members in musl libc
+only when _GNU_SOURCE is defined. See [3].
+
+Note: those use of udphdr members in checksums.c were introduced in
+commit [4], in version 2.1.1.
+
+This commit fixes the issue by defining _GNU_SOURCE in checksums.c.
+
+This issue was found in the iperf integration in Buildroot Linux [5].
+
+[1] https://www.musl-libc.org/
+[2] https://sourceforge.net/p/iperf2/code/ci/2a5fe6ffd4519ef3c6fc95704096646f897bd124/
+[3] https://git.musl-libc.org/cgit/musl/tree/include/netinet/udp.h?h=v1.2.5#n11
+[4] https://sourceforge.net/p/iperf2/code/ci/2ba97baecb4930e373ee5f51fc84115246e85096/
+[5] https://buildroot.org/
+
+Signed-off-by: Julien Olivain <[email protected]>
+
+--- a/src/checksums.c
++++ b/src/checksums.c
+@@ -47,6 +47,9 @@
+  * by Robert J. McMahon ([email protected][email protected])
+  * -------------------------------------------------------------------
+  */
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
+ #include "headers.h"
+ /*