From e8ffca398f429e2d8ac4e2131c9aa54d13fb3fbf Mon Sep 17 00:00:00 2001 From: Weiping Pan Date: Thu, 16 Feb 2012 22:08:42 +0800 Subject: [PATCH] ifcfg-rh: add "VLAN=yes" in ifcfg Check "VLAN=yes" if "TYPE=Vlan" is missing. They have the same meaning. This patch is based on NM/vlan branch, commit 703196fcdb96ad0d4bf8dac572235e65ba02e844 Signed-off-by: Weiping Pan --- src/settings/plugins/ifcfg-rh/reader.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 3d19e66b46..42631a91c4 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -3712,6 +3712,18 @@ is_bond_device (const char *name, shvarFile *parsed) return FALSE; } +static gboolean +is_vlan_device (const char *name, shvarFile *parsed) +{ + g_return_val_if_fail (name != NULL, FALSE); + g_return_val_if_fail (parsed != NULL, FALSE); + + if (svTrueValue (parsed, "VLAN", FALSE)) + return TRUE; + + return FALSE; +} + static void parse_prio_map_list (NMSettingVlan *s_vlan, shvarFile *ifcfg, @@ -3977,6 +3989,8 @@ connection_from_file (const char *filename, if (!test_type) { if (is_bond_device (device, parsed)) type = g_strdup (TYPE_BOND); + else if (is_vlan_device (device, parsed)) + type = g_strdup (TYPE_VLAN); /* Test wireless extensions */ else if (is_wireless_device (device)) type = g_strdup (TYPE_WIRELESS);