NMConnection *connection,
const char *parent_iface)
{
- const char *iface;
-
- /* For any other virtual connection, NMSettingConnection:interface-name is
- * the virtual device name.
- */
- iface = nm_connection_get_interface_name (connection);
- g_return_val_if_fail (iface != NULL, NULL);
- return g_strdup (iface);
+ /* Default to just using NMSettingConnection:interface-name */
+ return g_strdup (nm_connection_get_interface_name (connection));
}
char *
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (!error || !*error, NULL);
- if (!nm_connection_is_virtual (connection)) {
- g_set_error (error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_FAILED,
- "failed to determine virtual interface name: connection type '%s' is not a software device",
- nm_connection_get_connection_type (connection));
- return NULL;
- }
-
if (!NM_DEVICE_FACTORY_GET_INTERFACE (factory)->get_connection_iface) {
g_set_error (error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
- "failed to determine virtual interface name: cannot generate name for %s",
+ "failed to determine interface name: cannot determine name for %s",
nm_connection_get_connection_type (connection));
return NULL;
}
g_set_error (error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
- "failed to determine virtual interface name: error generating name for %s",
+ "failed to determine interface name: error determine name for %s",
nm_connection_get_connection_type (connection));
return NULL;
}
g_set_error (error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
- "failed to determine virtual interface name: invalid name \"%s\" generated",
+ "failed to determine interface name: name \"%s\" is invalid",
ifname);
g_free (ifname);
return NULL;
/**
* get_connection_iface:
* @factory: the #NMDeviceFactory
- * @connection: the #NMConnection to return the virtual interface name for
- * @parent_iface: parent interface name
+ * @connection: the #NMConnection to return the interface name for
+ * @parent_iface: optional parent interface name for virtual devices
*
* Given a connection, returns the interface name that a device activating
* that connection would have.