Restore functionality in IPv4-only environments.

Apply a patch provided by Sangameshwar Babu.

Resolves: RHELPLAN-125872
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
This commit is contained in:
Michal Schmidt 2023-04-20 09:54:44 +02:00
parent f156c7f85d
commit 05c5631d0f
2 changed files with 52 additions and 2 deletions

43
0001-Update-qperf.c.patch Normal file
View File

@ -0,0 +1,43 @@
From 3d4ed395c32ae4c9a3b9a6ec83feb448eaa17b20 Mon Sep 17 00:00:00 2001
From: SangameshwarBabu <sangambabu1@gmail.com>
Date: Wed, 15 Jun 2022 00:10:36 +0530
Subject: [PATCH] Update qperf.c
Current version of qperf throws errors in environment with only ipv4 address
With ipv6.disable in kernel command line :
# qperf
unable to bind to listen port
strace :
9052 14:24:36.118470 socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) = -1 EAFNOSUPPORT (Address family not supported by protocol) <0.001313>
9052 14:24:36.119820 fstat(1</dev/pts/0<char 136:0>>, {st_dev=makedev(0, 23), st_ino=3, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=0, st_gid=5, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 0), st_atime=1651602272 /* 2022-05-03T14:24:32.680622196-0400 */, st_atime_nsec=680622196, st_mtime=1651602272 /* 2022-05-03T14:24:32.680622196-0400 */, st_mtime_nsec=680622196, st_ctime=1651602034 /* 2022-05-03T14:20:34.680622196-0400 */, st_ctime_nsec=680622196}) = 0 <0.000005>
9052 14:24:36.119866 write(1</dev/pts/0<char 136:0>>, "unable to bind to listen port\n", 30) = 30 <0.000039>
9052 14:24:36.119950 exit_group(1) = ?
9052 14:24:36.120060 +++ exited with 1 ++
With qperf version 0.4.9 we defined AI_FAMILY as AF_UNSPEC, starting
qperf 0.4.11 the same is changed to AF_INET6 which causes issues
when ipv6 is disabled at protocol layer (as a kernel command line
arguement). This patch reverses the behavior.
---
src/qperf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qperf.c b/src/qperf.c
index 89fe5b8f2eeb..4de0cceeb10f 100644
--- a/src/qperf.c
+++ b/src/qperf.c
@@ -1418,7 +1418,7 @@ server_listen(void)
AI *ai;
AI hints ={
.ai_flags = AI_PASSIVE | AI_NUMERICSERV,
- .ai_family = AF_INET6,
+ .ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM
};
AI *ailist = getaddrinfo_port(0, ListenPort, &hints);
--
2.39.2

View File

@ -1,7 +1,7 @@
Name: qperf Name: qperf
Summary: Measure socket and RDMA performance Summary: Measure socket and RDMA performance
Version: 0.4.11 Version: 0.4.11
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2 or BSD License: GPLv2 or BSD
Group: Networking/Diagnostic Group: Networking/Diagnostic
Source: https://github.com/linux-rdma/%{name}/archive/v%{version}.tar.gz Source: https://github.com/linux-rdma/%{name}/archive/v%{version}.tar.gz
@ -13,11 +13,14 @@ BuildRequires: autoconf automake
# RDMA is not currently built on 32-bit ARM: #1484155 # RDMA is not currently built on 32-bit ARM: #1484155
ExcludeArch: %{arm} ExcludeArch: %{arm}
# rhbz#2099772, https://github.com/linux-rdma/qperf/pull/25/
Patch0000: 0001-Update-qperf.c.patch
%description %description
Measure socket and RDMA performance. Measure socket and RDMA performance.
%prep %prep
%setup -q %autosetup -p1
%build %build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@ -34,6 +37,10 @@ make DESTDIR=%{buildroot} install
%_mandir/man1/qperf.1* %_mandir/man1/qperf.1*
%changelog %changelog
* Thu Apr 20 2023 Michal Schmidt <mschmidt@redhat.com> - 0.4.11-3
- Restore functionality in IPv4-only environments.
- Resolves: RHELPLAN-125872
* Wed Apr 07 2021 Honggang Li <honli@redhat.com> - 0.4.11-2 * Wed Apr 07 2021 Honggang Li <honli@redhat.com> - 0.4.11-2
- Add qperf for s390x - Add qperf for s390x
- Resolves: bz1933283 - Resolves: bz1933283