mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 06:00:32 +01:00
core: allow VLAN ids between 1 and 4095
nm_utils_new_vlan_name() should reject the reserved VLAN id 4095, and
the test case should not test reserved values 0 and 4095.
Fixes: 778207f23e
This commit is contained in:
parent
34050e9c0b
commit
9a56fa0b3f
2 changed files with 3 additions and 2 deletions
|
|
@ -2155,7 +2155,7 @@ nm_utils_new_vlan_name (const char *parent_iface, guint32 vlan_id)
|
|||
else if (vlan_id < 1000)
|
||||
id_len = 4;
|
||||
else {
|
||||
g_return_val_if_fail (vlan_id < 4096, NULL);
|
||||
g_return_val_if_fail (vlan_id < 4095, NULL);
|
||||
id_len = 5;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -879,7 +879,8 @@ test_nm_utils_new_vlan_name (void)
|
|||
gs_free char *vlan_id_s = NULL;
|
||||
guint vlan_id;
|
||||
|
||||
vlan_id = nmtst_get_rand_int () % 4096;
|
||||
/* Create a random VLAN id between 1 and 4094 */
|
||||
vlan_id = 1 + nmtst_get_rand_int () % 4094;
|
||||
|
||||
vlan_id_s = g_strdup_printf (".%d", vlan_id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue