summaryrefslogtreecommitdiffstats
path: root/sbin/etherswitchcfg
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
committersjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
commit7fcd33c1faf567506b5c0b4148c7a15a10788a5d (patch)
tree2c6f4d1ca5d1c643faea64e1f4c90105a1ab406a /sbin/etherswitchcfg
parent2a59274eda20cc626e28052fff7aa8b7bf6a3683 (diff)
parent5cca672bb0892f1c5da630c34a1f98e2de4d7064 (diff)
downloadFreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.zip
FreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.tar.gz
Merge head@256284
Diffstat (limited to 'sbin/etherswitchcfg')
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.86
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.8 b/sbin/etherswitchcfg/etherswitchcfg.8
index a8b8d1a..9cdbdd6 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.8
+++ b/sbin/etherswitchcfg/etherswitchcfg.8
@@ -1,5 +1,5 @@
.\" $FreeBSD$
-.Dd December 15, 2011
+.Dd September 20, 2013
.Dt ETHERSWITCHCFG 8
.Os
.Sh NAME
@@ -145,9 +145,9 @@ to indicate that frames on this port are tagged.
Control file for the ethernet switch driver.
.El
.Sh EXAMPLES
-Configure VLAN group 1 with a VID of 2 and makes ports 0 and 5 members,
+Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members
while excluding all other ports.
-Port 5 will send and receive tagged frames, while port 0 will be untagged.
+Port 5 will send and receive tagged frames while port 0 will be untagged.
Incoming untagged frames on port 0 are assigned to vlangroup1.
.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2
.Sh SEE ALSO
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index 1eef832..dd68e67 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)
OpenPOWER on IntegriCloud