mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 12:38:04 +02: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.
This commit is contained in:
parent
edbf766e96
commit
f23a46d4b7
1 changed files with 4 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue