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:
@@ -4493,13 +4493,10 @@ make_vlan_setting (shvarFile *ifcfg,
|
|||||||
/* Grab VLAN ID from interface name; this takes precedence over the
|
/* Grab VLAN ID from interface name; this takes precedence over the
|
||||||
* separate VLAN_ID property for backwards compat.
|
* 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) {
|
gint device_vlan_id = (gint) g_ascii_strtoll (p, &end, 10);
|
||||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
if (device_vlan_id >= 0 && device_vlan_id <= 4095 && end != p && !*end)
|
||||||
"Failed to determine VLAN ID from DEVICE '%s'",
|
vlan_id = device_vlan_id;
|
||||||
iface_name);
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user