summaryrefslogtreecommitdiff
path: root/src/devices/nm-device-bridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device-bridge.c')
-rw-r--r--src/devices/nm-device-bridge.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index 47c5f7e0c0..63bde86075 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -136,17 +136,13 @@ complete_connection (NMDevice *device,
GError **error)
{
NMSettingBridge *s_bridge;
- NMSettingConnection *s_con;
- guint32 i = 0;
- char *name;
- const GSList *iter;
- gboolean found;
nm_utils_complete_generic (connection,
NM_SETTING_BRIDGE_SETTING_NAME,
existing_connections,
NULL,
_("Bridge connection"),
+ "bridge",
TRUE);
s_bridge = nm_connection_get_setting_bridge (connection);
@@ -154,35 +150,6 @@ complete_connection (NMDevice *device,
s_bridge = (NMSettingBridge *) nm_setting_bridge_new ();
nm_connection_add_setting (connection, NM_SETTING (s_bridge));
}
- s_con = nm_connection_get_setting_connection (connection);
- g_return_val_if_fail (s_con != NULL, FALSE);
-
- /* Grab the first name that doesn't exist in either our connections
- * or a device on the system.
- */
- while (i < 500 && !nm_setting_connection_get_interface_name (s_con)) {
- name = g_strdup_printf ("br%u", i);
- /* check interface names */
- if (!nm_platform_link_exists (name)) {
- /* check existing bridge connections */
- for (iter = existing_connections, found = FALSE; iter; iter = g_slist_next (iter)) {
- NMConnection *candidate = iter->data;
-
- if (nm_connection_is_type (candidate, NM_SETTING_BRIDGE_SETTING_NAME)) {
- if (g_strcmp0 (nm_connection_get_interface_name (candidate), name) == 0) {
- found = TRUE;
- break;
- }
- }
- }
-
- if (!found)
- g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, name, NULL);
- }
-
- g_free (name);
- i++;
- }
return TRUE;
}