mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-15 11:50:21 +01:00
initrd: fix setting VLan ID in reader_parse_vlan()
g_ascii_strtoull() returns a guint64, which is very wrong to directly pass to the variadic argument list of g_object_set(). We expect a guint there and need to cast. While at it, use _nm_utils_ascii_str_to_int64() to parse and validate the input. (cherry picked from commitd506823d4f) (cherry picked from commit24177569c1)
This commit is contained in:
parent
477c6c3e70
commit
0a10468d79
1 changed files with 1 additions and 1 deletions
|
|
@ -640,7 +640,7 @@ parse_vlan (GHashTable *connections, char *argument)
|
|||
s_vlan = nm_connection_get_setting_vlan (connection);
|
||||
g_object_set (s_vlan,
|
||||
NM_SETTING_VLAN_PARENT, phy,
|
||||
NM_SETTING_VLAN_ID, g_ascii_strtoull (vlanid, NULL, 10),
|
||||
NM_SETTING_VLAN_ID, (guint) _nm_utils_ascii_str_to_int64 (vlanid, 10, 0, G_MAXUINT, G_MAXUINT),
|
||||
NULL);
|
||||
|
||||
if (argument && *argument)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue