summary refs log tree commit diff
path: root/libnm-util/nm-setting-vlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/nm-setting-vlan.c')
-rw-r--r--libnm-util/nm-setting-vlan.c12
1 files changed, 11 insertions, 1 deletions
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 <stdlib.h>
 #include <string.h>
@@ -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.