summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-02-17 16:12:46 +0100
committerLubomir Rintel <lkundrak@v3.sk>2016-02-17 16:35:26 +0100
commit528fc5b010cba6418f92af0790c0d89e4050f52f (patch)
treea1ab8f8295b85664408e4087e181b9b4e7929708
parent68cabcd12389ae34c78772d0aa9b49f5ecfd14a6 (diff)
downloadNetworkManager-lr/conn-device-ifname.tar.gz
device: optimize nm_manager_get_connection_iface()lr/conn-device-ifname
-rw-r--r--src/nm-manager.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 4eb5b81eab..589fc10f68 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -987,6 +987,20 @@ nm_manager_get_connection_iface (NMManager *self,
return NULL;
}
+ if ( !out_parent
+ && !NM_DEVICE_FACTORY_GET_INTERFACE (factory)->get_connection_iface) {
+ /* optimization. Shortcut lookup of the partent device. */
+ iface = g_strdup (nm_connection_get_interface_name (connection));
+ if (!iface) {
+ g_set_error (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_FAILED,
+ "failed to determine interface name: error determine name for %s",
+ nm_connection_get_connection_type (connection));
+ }
+ return iface;
+ }
+
parent = find_parent_device_for_connection (self, connection, factory);
iface = nm_device_factory_get_connection_iface (factory,
connection,