utils: drop both "master" and "controller" from the dictionary

If a generated connection matches a connection that uses interface name
as controller, we need to drop the existing value from the settings to
avoid conflicts. Therefore, both of them need to be dropped; controller
and master.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1833

Fixes: 3e4a2ebb3c ('all: use the new NMSettingConnection Controller property')

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
This commit is contained in:
Fernando Fernandez Mancera 2024-01-16 15:13:42 +01:00
parent 876e8a4da1
commit b9f7b1a17b

View file

@ -719,6 +719,10 @@ check_connection_controller(NMConnection *orig, NMConnection *candidate, GHashTa
nm_settings_connection_get_setting(con_controller, NM_META_SETTING_TYPE_CONNECTION);
if (nm_streq0(nm_setting_connection_get_interface_name(s_con_controller),
cand_controller)) {
remove_from_hash(settings,
props,
NM_SETTING_CONNECTION_SETTING_NAME,
NM_SETTING_CONNECTION_MASTER);
remove_from_hash(settings,
props,
NM_SETTING_CONNECTION_SETTING_NAME,