core: do not check 'match' settings when comparing connections

Match settings are already used for matching an existing connection to
a device, it does not really make sense to compare them with an
auto-generated connection that is not going to have them.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1585
This commit is contained in:
Alfonso Sánchez-Beato
2023-03-24 17:42:15 +00:00
committed by Thomas Haller
parent 5d28a0dd89
commit 2566e99fbe

View File

@@ -767,6 +767,10 @@ check_possible_match(NMConnection *orig,
if (!check_connection_s390_props(orig, candidate, settings)) if (!check_connection_s390_props(orig, candidate, settings))
return NULL; return NULL;
/* match properties are for matching from static to generated connections,
* so they are not really part of the difference. */
g_hash_table_remove(settings, NM_SETTING_MATCH_SETTING_NAME);
if (g_hash_table_size(settings) == 0) if (g_hash_table_size(settings) == 0)
return candidate; return candidate;
else else