diff options
author | Thomas Haller <thaller@redhat.com> | 2016-01-22 11:23:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-01-22 12:02:39 +0100 |
commit | 8715d61437060cacc68c156b1c8ed7bbce4b0a78 (patch) | |
tree | 505bfa7f1458e9362cdaab386dc2890550c96818 /src/tests | |
parent | bd74a9348f30121f96072bc2ec28babf1405b676 (diff) | |
download | NetworkManager-8715d61437060cacc68c156b1c8ed7bbce4b0a78.tar.gz |
libnm-core: fail verify() for NMSettingVlan for invalid vlan id
Point in case:
# ip link add link dummy0 name dummy0.vlan type vlan id 4095
RTNETLINK answers: Numerical result out of range
This potentially causes existing (invalid) connections to disappear
as they now fail verification.
Instead of adjusting the range of the GObject property
NM_SETTING_VLAN_ID, reject it during vlan. This is a bit more
forgiving to an older client that isn't aware of this new restriction,
so he can first set the value without raising a critical warning.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test-general-with-expect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tests/test-general-with-expect.c b/src/tests/test-general-with-expect.c index 31afd62d2a..91f3f33619 100644 --- a/src/tests/test-general-with-expect.c +++ b/src/tests/test-general-with-expect.c @@ -879,8 +879,8 @@ test_nm_utils_new_vlan_name (void) gs_free char *vlan_id_s = NULL; guint vlan_id; - /* Create a random VLAN id between 1 and 4094 */ - vlan_id = 1 + nmtst_get_rand_int () % 4094; + /* Create a random VLAN id between 0 and 4094 */ + vlan_id = nmtst_get_rand_int () % 4095; vlan_id_s = g_strdup_printf (".%d", vlan_id); |