diff options
author | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2011-02-17 06:46:31 +0000 |
---|---|---|
committer | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2011-02-17 06:46:31 +0000 |
commit | ca564c3b89fd8bf5920bd7ee6fa863374d86a51e (patch) | |
tree | 67fd1158a0c68cdfca96ffc666c9915c51d57fd9 /sbin/ifconfig | |
parent | 831d033d8f001f3d1c9ef01ab1962ea2af53b537 (diff) |
0-4095 inclusive is the correct (12 bit) vlan range
ok henning claudio miod
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 607493a3d79..de3ab9d4254 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.242 2010/11/09 21:14:47 jsg Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.243 2011/02/17 06:46:30 camield Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -3351,7 +3351,7 @@ setvlantag(const char *val, int d) struct vlanreq vreq; const char *errmsg = NULL; - __tag = tag = strtonum(val, 0, 65535, &errmsg); + __tag = tag = strtonum(val, 0, 4095, &errmsg); if (errmsg) errx(1, "vlan tag %s: %s", val, errmsg); __have_tag = 1; @@ -3411,7 +3411,7 @@ setvlandev(const char *val, int d) if (!__have_tag && vreq.vlr_tag == 0) { skip = strcspn(ifr.ifr_name, "0123456789"); - tag = strtonum(ifr.ifr_name + skip, 1, 4095, &estr); + tag = strtonum(ifr.ifr_name + skip, 0, 4095, &estr); if (estr != NULL) errx(1, "invalid vlan tag and device specification"); vreq.vlr_tag = tag; |