device-factory: always prefer manually set interface name to a generated one

If the connection specifies an interface name, it should never attach to
a device of a different name even if the factory thinks the connection
is compatible with the device.

This fixes an issue that caused the inifniband connections to attach to
different devices or partitions.

(cherry picked from commit 332994f1b1)
This commit is contained in:
Lubomir Rintel 2016-04-18 18:57:15 +02:00
parent 60226446b3
commit 4abb943e84

View file

@ -187,10 +187,9 @@ nm_device_factory_get_connection_iface (NMDeviceFactory *factory,
klass = NM_DEVICE_FACTORY_GET_INTERFACE (factory);
if (klass->get_connection_iface)
ifname = g_strdup (nm_connection_get_interface_name (connection));
if (!ifname && klass->get_connection_iface)
ifname = klass->get_connection_iface (factory, connection, parent_iface);
else
ifname = g_strdup (nm_connection_get_interface_name (connection));
if (!ifname) {
g_set_error (error,