diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2013-10-13 02:35:19 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2013-10-13 02:35:19 +0000 |
| commit | 3caf0790a80c2e10c82a3a07719cddb2065c65d1 (patch) | |
| tree | 2c6f4d1ca5d1c643faea64e1f4c90105a1ab406a /sbin/etherswitchcfg | |
| parent | aab5fee0721846740415f201b41c920033a49303 (diff) | |
| parent | 006a42a9cb173cefe32d169c46748d6f00c41315 (diff) | |
Notes
Diffstat (limited to 'sbin/etherswitchcfg')
| -rw-r--r-- | sbin/etherswitchcfg/etherswitchcfg.8 | 6 | ||||
| -rw-r--r-- | sbin/etherswitchcfg/etherswitchcfg.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.8 b/sbin/etherswitchcfg/etherswitchcfg.8 index a8b8d1a9649f..9cdbdd661d1e 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 1eef832edb71..dd68e67c4ec9 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) |
