aboutsummaryrefslogtreecommitdiff
path: root/sbin/etherswitchcfg
diff options
context:
space:
mode:
authorHiren Panchasara <hiren@FreeBSD.org>2013-09-20 15:57:50 +0000
committerHiren Panchasara <hiren@FreeBSD.org>2013-09-20 15:57:50 +0000
commitba5ff393cd928a98803b06f7cd1c8f1486910345 (patch)
tree7eaea01d27113ab3f412493d425690da5158b1e1 /sbin/etherswitchcfg
parent428b7ca290208e6b15d46440cd8d6309dc92dd2d (diff)
Notes
Diffstat (limited to 'sbin/etherswitchcfg')
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index 1eef832edb710..dd68e67c4ec97 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -274,7 +274,7 @@ set_vlangroup_vid(struct cfg *cfg, char *argv[])
etherswitch_vlangroup_t vg;
v = strtol(argv[1], NULL, 0);
- if (v < 0 || v >= IEEE802DOT1Q_VID_MAX)
+ if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX);
vg.es_vlangroup = cfg->unit;
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
@@ -623,7 +623,7 @@ main(int argc, char *argv[])
print_info(&cfg);
} else if (sscanf(argv[0], "port%d", &cfg.unit) == 1) {
if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nports)
- errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nports);
+ errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nports - 1);
newmode(&cfg, MODE_PORT);
} else if (sscanf(argv[0], "vlangroup%d", &cfg.unit) == 1) {
if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups)