From 1d01cd587c097ae7c09910f651edee8fce4b8262 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 15 Mar 2016 12:02:53 +0100 Subject: [PATCH] device: don't update applied connection for generated assumed devices The applied connection must describe the configuration that was initially activated on the device. Even if the IP configuration changes, we shouldn't reset the applied connection for devices using a generated-assumed connection, otherwise we would lose information on the IP method we're trying on the device. (cherry picked from commit c84fd50287086082a8037ccb112f99b1026edd17) --- src/devices/nm-device.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index bd38f04445..72925be35a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -8024,23 +8024,16 @@ nm_device_set_ip4_config (NMDevice *self, nm_exported_object_clear_and_unexport (&old_config); if (nm_device_uses_generated_assumed_connection (self)) { - NMConnection *connection = nm_device_get_applied_connection (self); NMConnection *settings_connection = NM_CONNECTION (nm_device_get_settings_connection (self)); NMSetting *s_ip4; - g_object_freeze_notify (G_OBJECT (connection)); g_object_freeze_notify (G_OBJECT (settings_connection)); nm_connection_remove_setting (settings_connection, NM_TYPE_SETTING_IP4_CONFIG); s_ip4 = nm_ip4_config_create_setting (priv->ip4_config); nm_connection_add_setting (settings_connection, s_ip4); - nm_connection_remove_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); - s_ip4 = nm_ip4_config_create_setting (priv->ip4_config); - nm_connection_add_setting (connection, s_ip4); - g_object_thaw_notify (G_OBJECT (settings_connection)); - g_object_thaw_notify (G_OBJECT (connection)); } nm_device_queue_recheck_assume (self); @@ -8192,23 +8185,16 @@ nm_device_set_ip6_config (NMDevice *self, nm_exported_object_clear_and_unexport (&old_config); if (nm_device_uses_generated_assumed_connection (self)) { - NMConnection *connection = nm_device_get_applied_connection (self); NMConnection *settings_connection = NM_CONNECTION (nm_device_get_settings_connection (self)); NMSetting *s_ip6; - g_object_freeze_notify (G_OBJECT (connection)); g_object_freeze_notify (G_OBJECT (settings_connection)); nm_connection_remove_setting (settings_connection, NM_TYPE_SETTING_IP6_CONFIG); s_ip6 = nm_ip6_config_create_setting (priv->ip6_config); nm_connection_add_setting (settings_connection, s_ip6); - nm_connection_remove_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); - s_ip6 = nm_ip6_config_create_setting (priv->ip6_config); - nm_connection_add_setting (connection, s_ip6); - g_object_thaw_notify (G_OBJECT (settings_connection)); - g_object_thaw_notify (G_OBJECT (connection)); } nm_device_queue_recheck_assume (self);