import iproute-5.12.0-4.el8

This commit is contained in:
CentOS Sources 2021-10-15 16:30:46 +00:00 committed by Stepan Oksanichenko
parent 0ea090084e
commit c39bd94086
2 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,67 @@
From d1f0f7f4e3e3a372a51e64bdd88f8ddecde1fbbf Mon Sep 17 00:00:00 2001
Message-Id: <d1f0f7f4e3e3a372a51e64bdd88f8ddecde1fbbf.1633614399.git.aclaudi@redhat.com>
In-Reply-To: <650694eb0120722499207078f965442ef7343bb1.1633614399.git.aclaudi@redhat.com>
References: <650694eb0120722499207078f965442ef7343bb1.1633614399.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 28 Sep 2021 11:46:43 +0200
Subject: [PATCH] lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1995082
Upstream Status: iproute2.git commit 2f5825cb
commit 2f5825cb38028a14961a79844a069be4e3057eca
Author: Andrea Claudi <aclaudi@redhat.com>
Date: Tue Sep 21 11:33:24 2021 +0200
lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists
bpf selftests using iproute2 fails with:
$ ip link set dev veth0 xdp object ../bpf/xdp_dummy.o section xdp_dummy
Continuing without mounted eBPF fs. Too old kernel?
mkdir (null)/globals failed: No such file or directory
Unable to load program
This happens when the /sys/fs/bpf directory exists. In this case, mkdir
in bpf_mnt_check_target() fails with errno == EEXIST, and the function
returns -1. Thus bpf_get_work_dir() does not call bpf_mnt_fs() and the
bpffs is not mounted.
Fix this in bpf_mnt_check_target(), returning 0 when the mountpoint
exists.
Fixes: d4fcdbbec9df ("lib/bpf: Fix and simplify bpf_mnt_check_target()")
Reported-by: Mingyu Shi <mshi@redhat.com>
Reported-by: Jiri Benc <jbenc@redhat.com>
Suggested-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/bpf_legacy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 7ec9ce9d..f9dfad6e 100644
--- a/lib/bpf_legacy.c
+++ b/lib/bpf_legacy.c
@@ -513,9 +513,12 @@ static int bpf_mnt_check_target(const char *target)
int ret;
ret = mkdir(target, S_IRWXU);
- if (ret && errno != EEXIST)
+ if (ret) {
+ if (errno == EEXIST)
+ return 0;
fprintf(stderr, "mkdir %s failed: %s\n", target,
strerror(errno));
+ }
return ret;
}
--
2.31.1

View File

@ -1,7 +1,7 @@
Summary: Advanced IP routing and network device configuration tools
Name: iproute
Version: 5.12.0
Release: 3%{?dist}%{?buildid}
Release: 4%{?dist}%{?buildid}
Group: Applications/System
URL: http://kernel.org/pub/linux/utils/net/%{name}2/
Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz
@ -16,6 +16,7 @@ Patch5: 0006-police-Add-support-for-json-output.patch
Patch6: 0007-police-Fix-normal-output-back-to-what-it-was.patch
Patch7: 0008-tc-u32-Fix-key-folding-in-sample-option.patch
Patch8: 0009-tc-htb-improve-burst-error-messages.patch
Patch9: 0010-lib-bpf_legacy-fix-bpffs-mount-when-sys-fs-bpf-exist.patch
License: GPLv2+ and Public Domain
BuildRequires: bison
BuildRequires: elfutils-libelf-devel
@ -146,6 +147,9 @@ install -D -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/iproute2.sh
%{_includedir}/iproute2/bpf_elf.h
%changelog
* Thu Oct 07 2021 Andrea Claudi <aclaudi@redhat.com> [5.12.0-4.el8]
- lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists (Andrea Claudi) [1995082]
* Thu Aug 12 2021 Andrea Claudi <aclaudi@redhat.com> [5.12.0-3.el8]
- tc: htb: improve burst error messages (Andrea Claudi) [1910745]
- tc: u32: Fix key folding in sample option (Andrea Claudi) [1979425]