summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2000-05-15 19:15:01 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2000-05-15 19:15:01 +0000
commit953a28f86947804e097e99a07a2b8334dae05c79 (patch)
treefa43a5b44f57d193ead15f70c408d0da1305df05
parent8cf9a2b156a83fad04b41b84db6bcc22153c33d5 (diff)
Check to make sure vlan tag is valid (12bit) in SIOCSETVLAN
-rw-r--r--sys/net/if_vlan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 6cd892e2739..f7e151e93ad 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.3 2000/04/27 00:00:24 chris Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.4 2000/05/15 19:15:00 chris Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
*
@@ -521,6 +521,10 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ifp->if_flags &= ~(IFF_UP|IFF_RUNNING);
break;
}
+ if (vlr.vlr_tag != EVL_VLANOFTAG(vlr.vlr_tag)) {
+ error = EINVAL; /* check for valid tag */
+ break;
+ }
pr = ifunit(vlr.vlr_parent);
if (pr == 0) {
error = ENOENT;