summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-27 08:29:03 +0200
committerThomas Haller <thaller@redhat.com>2023-04-27 08:29:03 +0200
commite66b93b01e23a57090550b28eb5e34c88886fcbd (patch)
treedabfc5e051b3e99ee3ade54345e47edeff5d86a7
parent840abc6c452614b18cea64429b98870d984532d4 (diff)
parente699dff46a7b24be9974bb779fd23b0802ba7a39 (diff)
downloadNetworkManager-e66b93b01e23a57090550b28eb5e34c88886fcbd.tar.gz
core: merge branch 'th/rh2152864-ovs-autoactivate'
https://bugzilla.redhat.com/show_bug.cgi?id=2152864 Fixes-test: @NM_reboot_openvswitch_vlan_configuration_var2 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1603
-rw-r--r--src/core/devices/nm-device.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 3f14105d85..c69bb44804 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -7860,6 +7860,10 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error)
/* Garbage-collect unneeded unrealized devices. */
nm_device_recheck_available_connections(self);
+ /* In case the unrealized device is not going away, it may need to
+ * autoactivate. Schedule also a check for that. */
+ nm_device_emit_recheck_auto_activate(self);
+
return TRUE;
}
@@ -13568,7 +13572,8 @@ delete_cb(NMDevice *self,
GError *error,
gpointer user_data)
{
- GError *local = NULL;
+ NMSettingsConnection *sett_conn;
+ GError *local = NULL;
if (error) {
g_dbus_method_invocation_return_gerror(context, error);
@@ -13583,10 +13588,26 @@ delete_cb(NMDevice *self,
/* Authorized */
nm_audit_log_device_op(NM_AUDIT_OP_DEVICE_DELETE, self, TRUE, NULL, subject, NULL);
- if (nm_device_unrealize(self, TRUE, &local))
- g_dbus_method_invocation_return_value(context, NULL);
- else
+
+ sett_conn = nm_device_get_settings_connection(self);
+ if (sett_conn) {
+ /* Block profile from autoconnecting. We block the profile, which may
+ * be ugly/wrong with multi-connect profiles. However, it's not
+ * obviously wrong, because profiles for software devices tend not to
+ * work with multi-connect anyway, because they describe a (unique)
+ * interface by name. */
+ nm_settings_connection_autoconnect_blocked_reason_set(
+ sett_conn,
+ NM_SETTINGS_AUTOCONNECT_BLOCKED_REASON_USER_REQUEST,
+ TRUE);
+ }
+
+ if (!nm_device_unrealize(self, TRUE, &local)) {
g_dbus_method_invocation_take_error(context, local);
+ return;
+ }
+
+ g_dbus_method_invocation_return_value(context, NULL);
}
static void