Date: Fri, 20 Sep 2013 15:57:51 +0000 (UTC) From: Hiren Panchasara <hiren@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255730 - head/sbin/etherswitchcfg Message-ID: <201309201557.r8KFvpVp052769@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hiren Date: Fri Sep 20 15:57:50 2013 New Revision: 255730 URL: http://svnweb.freebsd.org/changeset/base/255730 Log: Fix a range check and a display string. Reviewed by: loos Approved by: sbruno (mentor, implicit) Approved by: re (glebius) Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Fri Sep 20 07:45:37 2013 (r255729) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Fri Sep 20 15:57:50 2013 (r255730) @@ -274,7 +274,7 @@ set_vlangroup_vid(struct cfg *cfg, char 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309201557.r8KFvpVp052769>