From c2de0d98ba39e0a1a970d066fd19be786092f376 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 1 Mar 2016 16:55:22 +0100 Subject: Imported Upstream version 1.1.91 --- libnm-util/nm-setting-vlan.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libnm-util/nm-setting-vlan.c') diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c index 310a7da8..32ad9394 100644 --- a/libnm-util/nm-setting-vlan.c +++ b/libnm-util/nm-setting-vlan.c @@ -19,7 +19,7 @@ * Copyright 2011 - 2014 Red Hat, Inc. */ -#include "config.h" +#include "nm-default.h" #include #include @@ -593,6 +593,16 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } + if (priv->id >= 4095) { + g_set_error (error, + NM_SETTING_VLAN_ERROR, + NM_SETTING_VLAN_ERROR_INVALID_PROPERTY, + _("the vlan id must be in range 0-4094 but is %u"), + priv->id); + g_prefix_error (error, "%s.%s: ", NM_SETTING_VLAN_SETTING_NAME, NM_SETTING_VLAN_ID); + return FALSE; + } + /* If interface_name is specified, it must be a valid interface name. We * don't check that it matches parent and/or id, because we allow * renaming vlans to arbitrary names. -- cgit 1.3.0-6-gf8a5