summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2018-11-10 18:14:47 +0000
committerkn <kn@openbsd.org>2018-11-10 18:14:47 +0000
commit115ef4e26647080f7601c857f5fef7389495e03a (patch)
treeefd2b60d8c1eedae26fd1d224cd1f09a7c935a08
parentfree(9) sizes for endpoints array. (diff)
downloadwireguard-openbsd-115ef4e26647080f7601c857f5fef7389495e03a.tar.xz
wireguard-openbsd-115ef4e26647080f7601c857f5fef7389495e03a.zip
Fix vnetid range
0 and 4095 are reserved IDs as per 802.1Q and vlan(4), setting them will fail. OK denis
-rw-r--r--sbin/ifconfig/ifconfig.86
-rw-r--r--sbin/ifconfig/ifconfig.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 392c79f0355..2468f9eee70 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.319 2018/09/08 15:21:03 phessler Exp $
+.\" $OpenBSD: ifconfig.8,v 1.320 2018/11/10 18:14:47 kn Exp $
.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $
.\"
@@ -31,7 +31,7 @@
.\"
.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
.\"
-.Dd $Mdocdate: September 8 2018 $
+.Dd $Mdocdate: November 10 2018 $
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -1843,7 +1843,7 @@ headers in packets handled by
or
.Xr svlan 4
interfaces respectively.
-Valid tag values are from 1 to 4095 inclusive.
+Valid tag values are from 1 to 4094 inclusive.
.It Cm -vnetid
Clear the tag value.
Packets on a VLAN interface without a tag set will use a value of
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 7c691c62328..a494d63cf2d 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.380 2018/10/15 11:25:55 florian Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.381 2018/11/10 18:14:47 kn Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -4033,7 +4033,7 @@ setvlantag(const char *val, int d)
struct vlanreq vreq;
const char *errmsg = NULL;
- __tag = tag = strtonum(val, 0, 4095, &errmsg);
+ __tag = tag = strtonum(val, EVL_VLID_MIN, EVL_VLID_MAX, &errmsg);
if (errmsg)
errx(1, "vlan tag %s: %s", val, errmsg);
__have_tag = 1;