summaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifconfig.c
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2013-05-31 19:56:07 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2013-05-31 19:56:07 +0000
commitaac6227b729931fcaf728dfe6eb363f690028d25 (patch)
treece8eeedf4ae318f8a4d308c55f72c8b30ea5892c /sbin/ifconfig/ifconfig.c
parentcf2acb329c9737da4b477bbed93142c168266057 (diff)
Correct the range checks in ifconfig properly for vhid, advbase and advskew.
Clarify about the ranges in the man page. ok mpf mcbride
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r--sbin/ifconfig/ifconfig.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 3a197f83984..71d396bfbd8 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.263 2013/04/25 06:41:46 otto Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.264 2013/05/31 19:56:06 yasuoka Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -3430,7 +3430,7 @@ setcarp_advskew(const char *val, int d)
struct carpreq carpr;
int advskew;
- advskew = strtonum(val, 0, 255, &errmsg);
+ advskew = strtonum(val, 0, 254, &errmsg);
if (errmsg)
errx(1, "advskew %s: %s", val, errmsg);
@@ -3454,7 +3454,7 @@ setcarp_advbase(const char *val, int d)
struct carpreq carpr;
int advbase;
- advbase = strtonum(val, 0, 255, &errmsg);
+ advbase = strtonum(val, 0, 254, &errmsg);
if (errmsg)
errx(1, "advbase %s: %s", val, errmsg);
@@ -3609,7 +3609,7 @@ setcarp_nodes(const char *val, int d)
if (sscanf(str, "%u:%u", &vhid, &advskew) != 2) {
errx(1, "non parsable arg: %s", str);
}
- if (vhid >= 255)
+ if (vhid > 255)
errx(1, "vhid %u: value too large", vhid);
if (advskew >= 255)
errx(1, "advskew %u: value too large", advskew);