From 9b4cffc559f2931615589214f9641ac3e2cc6f2e Mon Sep 17 00:00:00 2001 From: Gris Ge Date: Tue, 27 Jun 2023 15:02:54 +0800 Subject: [PATCH] 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 (cherry picked from commit 0486efd3584c70179072f611e63b9c0ff6851b80) (cherry picked from commit 18ce5f43bd16b3cc394424619652c782cb3795c3) (cherry picked from commit 2695396939d2a867145f7db569aaf5cc6b0d742c) (cherry picked from commit 32d2e3c14b1aaa6c92c06653750a84e9f41c6ab1) (cherry picked from commit 387ae9d7ff6217f7d77aafd487a7d64d7348ee7a) (cherry picked from commit 6f2c7733ce12f0ea13ca0806980c80abdb4ee5be) (cherry picked from commit 34f7499f3c3f5972d032283fd14d3f35f6fe3643) --- 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 81f31e12ba..9ef172f51c 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -12651,6 +12651,7 @@ check_and_reapply_connection(NMDevice * self, NMSettingIPConfig * s_ip4_old, *s_ip4_new; NMSettingIPConfig * s_ip6_old, *s_ip6_new; GHashTableIter iter; + NMSettingsConnection *sett_conn; if (priv->state < NM_DEVICE_STATE_PREPARE || priv->state > NM_DEVICE_STATE_ACTIVATED) { g_set_error_literal(error, @@ -12808,6 +12809,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; }