summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-09-25 18:07:56 +0200
committerJiří Klimeš <jklimes@redhat.com>2014-09-26 10:11:52 +0200
commitaccaedbc37acaefa18b75140a4a0250b80920b9f (patch)
tree00ae2e78c81eb06de319fdb856f3c4f3a1c6d1b8
parent6ae3c1bb828bebd708d6dc9992c780ee58f7fe9f (diff)
downloadNetworkManager-accaedbc37acaefa18b75140a4a0250b80920b9f.tar.gz
ifcfg-rh: fix handling VLAN connections as bond/bridge slaves (bgo #737377)
MASTER=something denotes a bond slave. Thus we cannot write it for VLAN setting. When reading, set the correct 'bond' slave type, not 'vlan'. https://bugzilla.gnome.org/show_bug.cgi?id=737377
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c19
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c3
2 files changed, 5 insertions, 17 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 901996f64f..1fe2595567 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -4376,7 +4376,6 @@ parse_prio_map_list (NMSettingVlan *s_vlan,
static NMSetting *
make_vlan_setting (shvarFile *ifcfg,
const char *file,
- char **out_master,
GError **error)
{
NMSettingVlan *s_vlan = NULL;
@@ -4429,7 +4428,7 @@ make_vlan_setting (shvarFile *ifcfg,
}
p++;
} else {
- /* format like vlan43; PHYSDEV or MASTER must be set */
+ /* format like vlan43; PHYSDEV must be set */
if (g_str_has_prefix (iface_name, "vlan"))
p = iface_name + 4;
}
@@ -4479,8 +4478,6 @@ make_vlan_setting (shvarFile *ifcfg,
parse_prio_map_list (s_vlan, ifcfg, "VLAN_INGRESS_PRIORITY_MAP", NM_VLAN_INGRESS_MAP);
parse_prio_map_list (s_vlan, ifcfg, "VLAN_EGRESS_PRIORITY_MAP", NM_VLAN_EGRESS_MAP);
- if (out_master)
- *out_master = svGetValue (ifcfg, "MASTER", FALSE);
return (NMSetting *) s_vlan;
error:
@@ -4500,7 +4497,6 @@ vlan_connection_from_ifcfg (const char *file,
NMSetting *wired_setting = NULL;
NMSetting *vlan_setting = NULL;
NMSetting8021x *s_8021x = NULL;
- char *master = NULL;
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
@@ -4514,24 +4510,17 @@ vlan_connection_from_ifcfg (const char *file,
g_object_unref (connection);
return NULL;
}
+ check_if_bond_slave (ifcfg, NM_SETTING_CONNECTION (con_setting));
+ check_if_team_slave (ifcfg, NM_SETTING_CONNECTION (con_setting));
nm_connection_add_setting (connection, con_setting);
- vlan_setting = make_vlan_setting (ifcfg, file, &master, error);
+ vlan_setting = make_vlan_setting (ifcfg, file, error);
if (!vlan_setting) {
g_object_unref (connection);
return NULL;
}
nm_connection_add_setting (connection, vlan_setting);
- /* Handle master interface or connection */
- if (master) {
- g_object_set (con_setting, NM_SETTING_CONNECTION_MASTER, master, NULL);
- g_object_set (con_setting,
- NM_SETTING_CONNECTION_SLAVE_TYPE, NM_SETTING_VLAN_SETTING_NAME,
- NULL);
- g_free (master);
- }
-
wired_setting = make_wired_setting (ifcfg, file, &s_8021x, error);
if (!wired_setting) {
g_object_unref (connection);
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index 106add4331..ffc83a3c67 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2009 - 2013 Red Hat, Inc.
+ * Copyright 2009 - 2014 Red Hat, Inc.
*/
#include <string.h>
@@ -1179,7 +1179,6 @@ write_vlan_setting (NMConnection *connection, shvarFile *ifcfg, gboolean *wired,
svSetValue (ifcfg, "TYPE", TYPE_VLAN, FALSE);
svSetValue (ifcfg, "DEVICE", nm_setting_connection_get_interface_name (s_con), FALSE);
svSetValue (ifcfg, "PHYSDEV", nm_setting_vlan_get_parent (s_vlan), FALSE);
- svSetValue (ifcfg, "MASTER", nm_setting_connection_get_master (s_con), FALSE);
tmp = g_strdup_printf ("%d", nm_setting_vlan_get_id (s_vlan));
svSetValue (ifcfg, "VLAN_ID", tmp, FALSE);