core: don't override user provided "connection.interface-name" in nm_utils_complete_generic()

nm_utils_complete_generic() is supposed to complete information which the user
didn't provide. If the profile already has an interface-name, keep it.
This commit is contained in:
Thomas Haller 2021-07-02 08:21:07 +02:00
parent bc57c79d57
commit eb634c6077
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -268,7 +268,9 @@ nm_utils_complete_generic(NMPlatform * platform,
}
/* Add an interface name, if requested */
if (ifname) {
if (nm_setting_connection_get_interface_name(s_con)) {
/* pass */
} else if (ifname) {
g_object_set(G_OBJECT(s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, NULL);
} else if (ifname_prefix && !nm_setting_connection_get_interface_name(s_con)) {
generated_ifname = get_new_connection_ifname(platform, existing_connections, ifname_prefix);