unblock autoconnect of profile on reapply (rh #2207690)

Resolves: #2207690
This commit is contained in:
Thomas Haller 2023-06-28 14:14:24 +02:00
parent be40f1d84c
commit 32ca43e190
No known key found for this signature in database
GPG Key ID: 29C2366E4DFC5728
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,47 @@
From 04c0fffdc3a24b66fcfd2e55714bc1308c219c24 Mon Sep 17 00:00:00 2001
From: Gris Ge <fge@redhat.com>
Date: Tue, 27 Jun 2023 15:02:54 +0800
Subject: [PATCH 1/1] setting-connection: Unblock autoconnect upon finish of
`Reapply`
The activation of a connection will clear the block of autoconnect,
we should do the same for reapply.
Signed-off-by: Gris Ge <fge@redhat.com>
(cherry picked from commit 0486efd3584c70179072f611e63b9c0ff6851b80)
(cherry picked from commit 18ce5f43bd16b3cc394424619652c782cb3795c3)
(cherry picked from commit 2695396939d2a867145f7db569aaf5cc6b0d742c)
---
src/core/devices/nm-device.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 31acc1c1fe6b..2ac55fa83cbe 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -12826,6 +12826,7 @@ check_and_reapply_connection(NMDevice *self,
NMConnection *con_old;
NMConnection *con_new;
GHashTableIter iter;
+ NMSettingsConnection *sett_conn;
if (priv->state < NM_DEVICE_STATE_PREPARE || priv->state > NM_DEVICE_STATE_ACTIVATED) {
g_set_error_literal(error,
@@ -12998,6 +12999,14 @@ check_and_reapply_connection(NMDevice *self,
if (priv->state >= NM_DEVICE_STATE_ACTIVATED)
nm_device_update_metered(self);
+ sett_conn = nm_device_get_settings_connection(self);
+ if (sett_conn) {
+ nm_settings_connection_autoconnect_blocked_reason_set(
+ sett_conn,
+ NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST,
+ FALSE);
+ }
+
return TRUE;
}
--
2.40.1

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 7 %global release_version 8
%global snapshot %{nil} %global snapshot %{nil}
%global git_sha %{nil} %global git_sha %{nil}
%global bcond_default_debug 0 %global bcond_default_debug 0
@ -202,6 +202,7 @@ Patch1003: 1003-suppport-bond-port-prio-rh1920398.patch
Patch1004: 1004-team-don-t-try-to-connect-to-teamd-in-update_connect-rh2182029.patch Patch1004: 1004-team-don-t-try-to-connect-to-teamd-in-update_connect-rh2182029.patch
Patch1005: 1005-ipv6ll-don-t-regenerate-the-address-when-removed-rh2209353.patch 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
Requires(post): systemd Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
@ -1237,6 +1238,9 @@ fi
%changelog %changelog
* Wed Jun 28 2023 Thomas Haller <thaller@redhat.com> - 1:1.40.16-8
- unblock autoconnect of profile on reapply (rh #2207690)
* Mon Jun 5 2023 Thomas Haller <thaller@redhat.com> - 1:1.40.16-7 * Mon Jun 5 2023 Thomas Haller <thaller@redhat.com> - 1:1.40.16-7
- fix reading infiniband p-key from ifcfg files (rh #2209164) - fix reading infiniband p-key from ifcfg files (rh #2209164)