summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-06-23 21:08:29 +0200
committerLubomir Rintel <lkundrak@v3.sk>2015-06-24 18:20:47 +0200
commitf23a46d4b79088344f9d0ad4528afb81f492f54c (patch)
treeb9b2564c5a96944975bb75fb8393878fc3386d75
parentedbf766e96332656fca5e3fe7ee86fb4597a6d55 (diff)
downloadNetworkManager-f23a46d4b79088344f9d0ad4528afb81f492f54c.tar.gz
ifcfg-rh,vlan: fall back to VLAN_ID if vlan id can't be determined from DEVICE
If the device begins with "vlan", but a VLAN ID does not follow, the reader would fail and ignore the actual VLAN_ID.
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 9dcf5f3b59..29c7854dd1 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -4493,13 +4493,10 @@ make_vlan_setting (shvarFile *ifcfg,
/* Grab VLAN ID from interface name; this takes precedence over the
* separate VLAN_ID property for backwards compat.
*/
- vlan_id = (gint) g_ascii_strtoll (p, &end, 10);
- if (vlan_id < 0 || vlan_id > 4095 || end == p || *end) {
- g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "Failed to determine VLAN ID from DEVICE '%s'",
- iface_name);
- goto error;
- }
+
+ gint device_vlan_id = (gint) g_ascii_strtoll (p, &end, 10);
+ if (device_vlan_id >= 0 && device_vlan_id <= 4095 && end != p && !*end)
+ vlan_id = device_vlan_id;
}
}