manager: allow controller activation if device is deactivating

Resolves: RHEL-5119
This commit is contained in:
Fernando Fernandez Mancera 2023-10-04 12:21:56 +02:00
parent 35213d2d27
commit eefa196ba2
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From a5826caf0607ca3c490bdc76d1d453226ca2e191 Mon Sep 17 00:00:00 2001
From: Fernando Fernandez Mancera <ffmancera@riseup.net>
Date: Tue, 18 Jul 2023 13:46:30 +0200
Subject: [PATCH] manager: allow controller activation if device is
deactivating
When activating a port connection it will require the controller
connection is active or a valid controller device candidate is available
for activation.
One of the conditions we consider for a controller device to be a valid
candidate for the connection is that it is not active, therefore we
should also consider as valid a device that is currently deactivating.
Otherwise, we could fail during the port activation just because the
deactivation of the controller device candidate didn't finish yet.
https://bugzilla.redhat.com/show_bug.cgi?id=2125615
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1693
(cherry picked from commit fb362e0583fe9b75269220c7c8b966e2247084ea)
(cherry picked from commit 43f244ef2e4c4052fe708b77244444ee7eff238c)
(cherry picked from commit 401f153dfb52d12495bb39899f2b4dde7dfb72ce)
---
src/core/nm-manager.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index 822df7ad3b..4ef87a5d83 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -4608,11 +4608,11 @@ ensure_master_active_connection(NMManager *self,
NULL))
continue;
- if (!nm_device_is_software(candidate)) {
- master_state = nm_device_get_state(candidate);
- if (nm_device_is_real(candidate) && master_state != NM_DEVICE_STATE_DISCONNECTED)
- continue;
- }
+ if (nm_device_is_real(candidate)
+ && !NM_IN_SET(nm_device_get_state(candidate),
+ NM_DEVICE_STATE_DISCONNECTED,
+ NM_DEVICE_STATE_DEACTIVATING))
+ continue;
master_ac = nm_manager_activate_connection(
self,
--
2.41.0

View File

@ -6,7 +6,7 @@
%global epoch_version 1 %global epoch_version 1
%global real_version 1.40.16 %global real_version 1.40.16
%global rpm_version %{real_version} %global rpm_version %{real_version}
%global release_version 9 %global release_version 10
%global snapshot %{nil} %global snapshot %{nil}
%global git_sha %{nil} %global git_sha %{nil}
%global bcond_default_debug 0 %global bcond_default_debug 0
@ -204,6 +204,7 @@ Patch1005: 1005-ipv6ll-don-t-regenerate-the-address-when-removed-rh2209353.patch
Patch1006: 1006-fix-read-infiniband-from-ifcfg-rh2209164.patch Patch1006: 1006-fix-read-infiniband-from-ifcfg-rh2209164.patch
Patch1007: 1007-unblock-autoconnect-on-reapply-rh2207690.patch Patch1007: 1007-unblock-autoconnect-on-reapply-rh2207690.patch
Patch1008: 1008-cloud-setup-fix-terminating-in-reconfig-rh2221903.patch Patch1008: 1008-cloud-setup-fix-terminating-in-reconfig-rh2221903.patch
Patch1009: 1009-manager-allow-controller-activation-if-device-is-dea-rhel-5119.patch
Requires(post): systemd Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
@ -1239,6 +1240,9 @@ fi
%changelog %changelog
* Wed Oct 04 2023 Fernando Fernandez Mancera <ferferna@redhat.com> - 1:1.40.16-10
- manager: allow controller activation if device is deactivating (RHEL-5119)
* Wed Jul 19 2023 Beniamino Galvani <bgalvani@redhat.com> - 1:1.40.16-9 * Wed Jul 19 2023 Beniamino Galvani <bgalvani@redhat.com> - 1:1.40.16-9
- cloud-setup: fix terminating in the middle of reconfiguration (rh #2221903) - cloud-setup: fix terminating in the middle of reconfiguration (rh #2221903)