Module Name: src
Committed By: msaitoh
Date: Wed Nov 22 04:56:52 UTC 2017
Modified Files:
src/sys/net: if_vlan.c
Log Message:
Return EINVAL in vlan_config() when a VLAN ID is 0 or 65535. The spec states
0 and 65535 are reserved.
To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/net/if_vlan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.110 src/sys/net/if_vlan.c:1.111
--- src/sys/net/if_vlan.c:1.110 Wed Nov 22 03:45:15 2017
+++ src/sys/net/if_vlan.c Wed Nov 22 04:56:52 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlan.c,v 1.110 2017/11/22 03:45:15 msaitoh Exp $ */
+/* $NetBSD: if_vlan.c,v 1.111 2017/11/22 04:56:52 msaitoh Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.110 2017/11/22 03:45:15 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.111 2017/11/22 04:56:52 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -415,6 +415,10 @@ vlan_config(struct ifvlan *ifv, struct i
bool omib_cleanup = false;
struct psref psref;
+ /* VLAN ID 0 and 65535 are reserved in the spec */
+ if ((vid == 0) || (vid == 0xfff))
+ return EINVAL;
+
nmib = kmem_alloc(sizeof(*nmib), KM_SLEEP);
mutex_enter(&ifv->ifv_lock);