mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-27 12:30:22 +01:00
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.
(cherry picked from commit f23a46d4b7)
This commit is contained in:
parent
525a2b1d95
commit
8c1e848401
1 changed files with 4 additions and 7 deletions
|
|
@ -4432,13 +4432,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue