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:22:08 +0200
commit0e8fb0add0ad37564176b192e1f6a91ed110df43 (patch)
tree3642f8ac4b1ae15c6031710f5db56a4a06817fc7
parent882287635155d0d404de69bed0aea424e7b58876 (diff)
downloadNetworkManager-0e8fb0add0ad37564176b192e1f6a91ed110df43.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) (cherry picked from commit b1209e37dba30e5e806130139c1edd3cb1b37095) (cherry picked from commit cacb80e5676bbb78ea4aae66639e947c5e014f21)
-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 7db8cb8c4b..5811c7e3d0 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -9560,7 +9560,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),