summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-07-16 09:24:25 +0200
committerThomas Haller <thaller@redhat.com>2019-07-18 12:21:26 +0200
commitb1209e37dba30e5e806130139c1edd3cb1b37095 (patch)
treefb2a2c57c60642f7c0107fdfba06ae1e54f7afb3
parent8f85b6a3afa876e5c07416957acb80dcf2a19b31 (diff)
downloadNetworkManager-b1209e37dba30e5e806130139c1edd3cb1b37095.tar.gz
device: fix reapplying changes to connection ID and UUID
4 properties are not really relevant for an already activated connection or it makes not sense to change them. These are connection.id, connection.uuid, connection.autoconnect and connection.stable-id. For convenience, we allow to reapply these. This way, one can take a different setting (e.g. with a different connection.id or connection.uuid) and reapply them, but such changes are silently ignored. However this was done wrongly. Instead of reverting the change to the new applied connection, we would change the input connection. This is bad, for example with nmcli connection up uuid cb922f18-e99a-49c6-b200-1678b5070a82 nmcli connection modify cb922f18-e99a-49c6-b200-1678b5070a82 con-name "bogus" nmcli device reapply eth0 the last re-apply would reset the settings-connection's connection ID to what was before, while accepting the new name on the applied-connection (while it should have been rejected). Fixes: bf3b3d444c77 ('device: avoid changing immutable properties during reapply') (cherry picked from commit adb51c2a7f05fd15b5a0c51c01a6a725201c8c4a) (cherry picked from commit 09f37d5bd4542011588921bf28105bd3c1b249ee) (cherry picked from commit 9c72ca5ee9e2d2f7543784f8778803ae472a4d81)
-rw-r--r--src/devices/nm-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 8fd7eb3f2f..1160fa8d06 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -11214,7 +11214,7 @@ check_and_reapply_connection (NMDevice *self,
|| !nm_streq0 (nm_setting_connection_get_stable_id (s_con_a), nm_setting_connection_get_stable_id (s_con_n))) {
connection_clean_free = nm_simple_connection_new_clone (connection);
connection_clean = connection_clean_free;
- s_con_n = nm_connection_get_setting_connection (connection);
+ s_con_n = nm_connection_get_setting_connection (connection_clean);
g_object_set (s_con_n,
NM_SETTING_CONNECTION_ID, nm_setting_connection_get_id (s_con_a),
NM_SETTING_CONNECTION_UUID, nm_setting_connection_get_uuid (s_con_a),