svn commit: r335680 - head/usr.sbin/cxgbetool
Navdeep Parhar
np at FreeBSD.org
Tue Jun 26 21:56:07 UTC 2018
Author: np
Date: Tue Jun 26 21:56:06 2018
New Revision: 335680
URL: https://svnweb.freebsd.org/changeset/base/335680
Log:
cxgbetool(8): Reject invalid VLAN values.
Submitted by: Krishnamraju Eraparaju @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications
Modified:
head/usr.sbin/cxgbetool/cxgbetool.c
Modified: head/usr.sbin/cxgbetool/cxgbetool.c
==============================================================================
--- head/usr.sbin/cxgbetool/cxgbetool.c Tue Jun 26 20:26:57 2018 (r335679)
+++ head/usr.sbin/cxgbetool/cxgbetool.c Tue Jun 26 21:56:06 2018 (r335680)
@@ -1102,6 +1102,8 @@ del_filter(uint32_t idx, int hashfilter)
return doit(CHELSIO_T4_DEL_FILTER, &t);
}
+#define MAX_VLANID (4095)
+
static int
set_filter(uint32_t idx, int argc, const char *argv[], int hash)
{
@@ -1308,7 +1310,8 @@ set_filter(uint32_t idx, int argc, const char *argv[],
t.fs.newvlan == VLAN_INSERT) {
t.fs.vlan = strtoul(argv[start_arg + 1] + 1,
&p, 0);
- if (p == argv[start_arg + 1] + 1 || p[0] != 0) {
+ if (p == argv[start_arg + 1] + 1 || p[0] != 0 ||
+ t.fs.vlan > MAX_VLANID) {
warnx("invalid vlan \"%s\"",
argv[start_arg + 1]);
return (EINVAL);
More information about the svn-src-head
mailing list