diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2013-05-31 19:56:07 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2013-05-31 19:56:07 +0000 |
commit | aac6227b729931fcaf728dfe6eb363f690028d25 (patch) | |
tree | ce8eeedf4ae318f8a4d308c55f72c8b30ea5892c /sbin/ifconfig | |
parent | cf2acb329c9737da4b477bbed93142c168266057 (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')
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 8 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 7c678717875..9e436602579 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifconfig.8,v 1.233 2013/03/14 11:18:37 mpi Exp $ +.\" $OpenBSD: ifconfig.8,v 1.234 2013/05/31 19:56:06 yasuoka 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: March 14 2013 $ +.Dd $Mdocdate: May 31 2013 $ .Dt IFCONFIG 8 .Os .Sh NAME @@ -769,11 +769,11 @@ interface: Set the base advertisement interval to .Ar n seconds. -This is an 8-bit number; the default value is 1 second. +Acceptable values are 0 to 254; the default value is 1 second. .It Cm advskew Ar n Skew the advertisement interval by .Ar n . -This is an 8-bit number; the default value is 0. +Acceptable values are 0 to 254; the default value is 0. .It Cm balancing Ar mode Set the load balancing mode to .Ar mode . 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); |