From 4abb943e8409d74e1a22088cbb03424927b4a538 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 18 Apr 2016 18:57:15 +0200 Subject: [PATCH] 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 332994f1b19ded7cb343ef573443916bab05aaec) --- src/devices/nm-device-factory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c index 9dfa9bcbac..482eb1855b 100644 --- a/src/devices/nm-device-factory.c +++ b/src/devices/nm-device-factory.c @@ -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,