From 54ff670423abf86b12833f980f8cff9c39f8c1b9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 9 Jul 2014 11:25:13 +0200 Subject: keyfile: don't add [connection].type base setting which is done by nm_connection_normalize() This undoes commit 9f8b7ff51dfd7cdb828fe5e7b50016c5587e8657 but the same functionality is now provided via normalize(). Signed-off-by: Thomas Haller --- src/settings/plugins/keyfile/reader.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c index 2e356b92e2..e2d1f823b0 100644 --- a/src/settings/plugins/keyfile/reader.c +++ b/src/settings/plugins/keyfile/reader.c @@ -1213,7 +1213,6 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error) gsize length; int i; gboolean vpn_secrets = FALSE; - const char *ctype; GError *verify_error = NULL; if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) { @@ -1250,31 +1249,11 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error) nm_connection_add_setting (connection, setting); } - /* Make sure that we have the base device type setting even if - * the keyfile didn't include it, which can happen when the base - * device type setting is all default values (like ethernet where - * the MAC address isn't given, or VLAN when the VLAN ID is zero). - */ s_con = nm_connection_get_setting_connection (connection); if (!s_con) { s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); nm_connection_add_setting (connection, NM_SETTING (s_con)); } - ctype = nm_setting_connection_get_connection_type (s_con); - if (ctype) { - setting = nm_connection_get_setting_by_name (connection, ctype); - if (!setting) { - NMSetting *base_setting; - GType base_setting_type; - - base_setting_type = nm_setting_lookup_type (ctype); - if (base_setting_type != G_TYPE_INVALID) { - base_setting = (NMSetting *) g_object_new (base_setting_type, NULL); - g_assert (base_setting); - nm_connection_add_setting (connection, base_setting); - } - } - } /* Make sure that we have 'id' even if not explictly specified in the keyfile */ if (!nm_setting_connection_get_id (s_con)) { -- cgit v1.2.1