summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2010-05-06 17:37:23 +0000
committermckusick <mckusick@FreeBSD.org>2010-05-06 17:37:23 +0000
commitb25e55dcc52d6203a9ae995ca470a66b6483f71d (patch)
tree781f2c991a11a3806fdb0891b7a615cb77ebe3ab /usr.sbin
parent3a0f5972a0de87aebef1af257922515700da4217 (diff)
parentf3856c6cf2fb115757967b7e32bdeb21bd27d1ee (diff)
downloadFreeBSD-src-b25e55dcc52d6203a9ae995ca470a66b6483f71d.zip
FreeBSD-src-b25e55dcc52d6203a9ae995ca470a66b6483f71d.tar.gz
Final update to current version of head in preparation for reintegration.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acpi/acpidb/Makefile5
-rw-r--r--usr.sbin/acpi/iasl/Makefile6
-rw-r--r--usr.sbin/config/config.h1
-rw-r--r--usr.sbin/config/configvers.h2
-rw-r--r--usr.sbin/config/main.c58
-rw-r--r--usr.sbin/config/mkmakefile.c45
-rw-r--r--usr.sbin/config/mkoptions.c168
-rw-r--r--usr.sbin/cxgbtool/cxgbtool.c186
-rw-r--r--usr.sbin/jail/jail.82
-rwxr-xr-xusr.sbin/mergemaster/mergemaster.sh14
10 files changed, 371 insertions, 116 deletions
diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index c2fe844..eed57f3 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -13,8 +13,9 @@ SRCS+= dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c \
dmresrcl.c dmresrcs.c dmutils.c dmwalk.c
# events
-SRCS+= evevent.c evgpe.c evgpeblk.c evmisc.c evregion.c \
- evrgnini.c evsci.c evxface.c evxfevnt.c evxfregn.c
+SRCS+= evevent.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c \
+ evmisc.c evregion.c evrgnini.c evsci.c evxface.c \
+ evxfevnt.c evxfregn.c
# hardware
SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwvalid.c hwxface.c
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index ea7a325..3e17cc9 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -14,8 +14,10 @@ SRCS+= aslanalyze.c aslcodegen.c aslcompile.c aslcompiler.y.h \
aslfiles.c aslfold.c asllength.c asllisting.c \
aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c \
asloperands.c aslopt.c aslpredef.c aslresource.c \
- aslrestype1.c aslrestype2.c aslstartup.c aslstubs.c \
- asltransform.c asltree.c aslutils.c
+ aslrestype1.c aslrestype1i.c aslrestype2.c \
+ aslrestype2d.c aslrestype2e.c aslrestype2q.c \
+ aslrestype2w.c aslstartup.c aslstubs.c asltransform.c \
+ asltree.c aslutils.c
# debugger
SRCS+= dbfileio.c
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index ec19986..4abb567 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -179,6 +179,7 @@ void makehints(void);
void headers(void);
void cfgfile_add(const char *);
void cfgfile_removeall(void);
+FILE *open_makefile_template(void);
extern STAILQ_HEAD(device_head, device) dtab;
diff --git a/usr.sbin/config/configvers.h b/usr.sbin/config/configvers.h
index 73310bd..2d43329 100644
--- a/usr.sbin/config/configvers.h
+++ b/usr.sbin/config/configvers.h
@@ -49,5 +49,5 @@
*
* $FreeBSD$
*/
-#define CONFIGVERS 600008
+#define CONFIGVERS 600009
#define MAJOR_VERS(x) ((x) / 100000)
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 2b5e055..e63e6ab 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -90,6 +90,7 @@ static void get_srcdir(void);
static void usage(void);
static void cleanheaders(char *);
static void kernconfdump(const char *);
+static void checkversion(void);
struct hdr_list {
char *h_name;
@@ -204,6 +205,7 @@ main(int argc, char **argv)
printf("cpu type must be specified\n");
exit(1);
}
+ checkversion();
/*
* make symbolic links in compilation directory
@@ -668,7 +670,7 @@ kernconfdump(const char *file)
struct stat st;
FILE *fp, *pp;
int error, len, osz, r;
- unsigned int i, off, size;
+ unsigned int i, off, size, t1, t2, align;
char *cmd, *o;
r = open(file, O_RDONLY);
@@ -687,8 +689,8 @@ kernconfdump(const char *file)
if (o == NULL)
err(EXIT_FAILURE, "Couldn't allocate memory");
/* ELF note section header. */
- asprintf(&cmd, "/usr/bin/elfdump -c %s | grep -A 5 kern_conf"
- "| tail -2 | cut -d ' ' -f 2 | paste - - -", file);
+ asprintf(&cmd, "/usr/bin/elfdump -c %s | grep -A 8 kern_conf"
+ "| tail -5 | cut -d ' ' -f 2 | paste - - - - -", file);
if (cmd == NULL)
errx(EXIT_FAILURE, "asprintf() failed");
pp = popen(cmd, "r");
@@ -697,27 +699,69 @@ kernconfdump(const char *file)
free(cmd);
len = fread(o, osz, 1, pp);
pclose(pp);
- r = sscanf(o, "%d\t%d", &off, &size);
+ r = sscanf(o, "%d%d%d%d%d", &off, &size, &t1, &t2, &align);
free(o);
- if (r != 2)
+ if (r != 5)
errx(EXIT_FAILURE, "File %s doesn't contain configuration "
"file. Either unsupported, or not compiled with "
"INCLUDE_CONFIG_FILE", file);
r = fseek(fp, off, SEEK_CUR);
if (r != 0)
err(EXIT_FAILURE, "fseek() failed");
- for (i = 0; i < size - 1; i++) {
+ for (i = 0; i < size; i++) {
r = fgetc(fp);
if (r == EOF)
break;
/*
* If '\0' is present in the middle of the configuration
* string, this means something very weird is happening.
- * Make such case very visible.
+ * Make such case very visible. However, some architectures
+ * pad the length of the section with NULs to a multiple of
+ * sh_addralign, allow a NUL in that part of the section.
*/
+ if (r == '\0' && (size - i) < align)
+ break;
assert(r != '\0' && ("Char present in the configuration "
"string mustn't be equal to 0"));
fputc(r, stdout);
}
fclose(fp);
}
+
+static void
+badversion(int versreq)
+{
+ fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n");
+ fprintf(stderr, "config version = %d, ", CONFIGVERS);
+ fprintf(stderr, "version required = %d\n\n", versreq);
+ fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n");
+ fprintf(stderr, "with your /usr/src/sys and install a new config binary\n");
+ fprintf(stderr, "before trying this again.\n\n");
+ fprintf(stderr, "If running the new config fails check your config\n");
+ fprintf(stderr, "file against the GENERIC or LINT config files for\n");
+ fprintf(stderr, "changes in config syntax, or option/device naming\n");
+ fprintf(stderr, "conventions\n\n");
+ exit(1);
+}
+
+static void
+checkversion(void)
+{
+ FILE *ifp;
+ char line[BUFSIZ];
+ int versreq;
+
+ ifp = open_makefile_template();
+ while (fgets(line, BUFSIZ, ifp) != 0) {
+ if (*line != '%')
+ continue;
+ if (strncmp(line, "%VERSREQ=", 9) != 0)
+ continue;
+ versreq = atoi(line + 9);
+ if (MAJOR_VERS(versreq) == MAJOR_VERS(CONFIGVERS) &&
+ versreq <= CONFIGVERS)
+ continue;
+ badversion(versreq);
+ }
+ fclose(ifp);
+}
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 7845089..b5a0e35 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -105,17 +105,14 @@ new_fent(void)
}
/*
- * Build the makefile from the skeleton
+ * Open the correct Makefile and return it, or error out.
*/
-void
-makefile(void)
+FILE *
+open_makefile_template(void)
{
- FILE *ifp, *ofp;
+ FILE *ifp;
char line[BUFSIZ];
- struct opt *op, *t;
- int versreq;
- read_files();
snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename);
ifp = fopen(line, "r");
if (ifp == 0) {
@@ -124,7 +121,21 @@ makefile(void)
}
if (ifp == 0)
err(1, "%s", line);
+ return (ifp);
+}
+/*
+ * Build the makefile from the skeleton
+ */
+void
+makefile(void)
+{
+ FILE *ifp, *ofp;
+ char line[BUFSIZ];
+ struct opt *op, *t;
+
+ read_files();
+ ifp = open_makefile_template();
ofp = fopen(path("Makefile.new"), "w");
if (ofp == 0)
err(1, "%s", path("Makefile.new"));
@@ -156,23 +167,9 @@ makefile(void)
do_rules(ofp);
else if (eq(line, "%CLEAN\n"))
do_clean(ofp);
- else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) {
- versreq = atoi(line + sizeof("%VERSREQ=") - 1);
- if (MAJOR_VERS(versreq) != MAJOR_VERS(CONFIGVERS) ||
- versreq > CONFIGVERS) {
- fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n");
- fprintf(stderr, "config version = %d, ", CONFIGVERS);
- fprintf(stderr, "version required = %d\n\n", versreq);
- fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n");
- fprintf(stderr, "with your /usr/src/sys and install a new config binary\n");
- fprintf(stderr, "before trying this again.\n\n");
- fprintf(stderr, "If running the new config fails check your config\n");
- fprintf(stderr, "file against the GENERIC or LINT config files for\n");
- fprintf(stderr, "changes in config syntax, or option/device naming\n");
- fprintf(stderr, "conventions\n\n");
- exit(1);
- }
- } else
+ else if (strncmp(line, "%VERSREQ=", 9) == 0)
+ line[0] = '\0'; /* handled elsewhere */
+ else
fprintf(stderr,
"Unknown %% construct in generic makefile: %s",
line);
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index 1a6ccc8..044b669 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -166,7 +166,7 @@ do_option(char *name)
fprintf(outf, "#define %s %s\n", name, value);
} /* else empty file */
- (void) fclose(outf);
+ (void)fclose(outf);
return;
}
basefile = "";
@@ -225,7 +225,7 @@ do_option(char *name)
if (cp == (char *)EOF)
break;
}
- (void) fclose(inf);
+ (void)fclose(inf);
if (!tidy && ((value == NULL && oldvalue == NULL) ||
(value && oldvalue && eq(value, oldvalue)))) {
while (!SLIST_EMPTY(&op_head)) {
@@ -263,7 +263,7 @@ do_option(char *name)
free(op->op_value);
free(op);
}
- (void) fclose(outf);
+ (void)fclose(outf);
}
/*
@@ -277,7 +277,7 @@ tooption(char *name)
struct opt_list *po;
/* "cannot happen"? the otab list should be complete.. */
- (void) strlcpy(nbuf, "options.h", sizeof(nbuf));
+ (void)strlcpy(nbuf, "options.h", sizeof(nbuf));
SLIST_FOREACH(po, &otab, o_next) {
if (eq(po->o_name, name)) {
@@ -286,78 +286,15 @@ tooption(char *name)
}
}
- (void) strlcpy(hbuf, path(nbuf), sizeof(hbuf));
+ (void)strlcpy(hbuf, path(nbuf), sizeof(hbuf));
return (hbuf);
}
-/*
- * read the options and options.<machine> files
- */
+
static void
-read_options(void)
+check_duplicate(const char *fname, const char *this)
{
- FILE *fp;
- char fname[MAXPATHLEN];
- char *wd, *this, *val;
struct opt_list *po;
- int first = 1;
- char genopt[MAXPATHLEN];
- int flags = 0;
-
- SLIST_INIT(&otab);
- (void) snprintf(fname, sizeof(fname), "../../conf/options");
-openit:
- fp = fopen(fname, "r");
- if (fp == 0) {
- return;
- }
-next:
- flags = 0;
- wd = get_word(fp);
- if (wd == (char *)EOF) {
- (void) fclose(fp);
- if (first == 1) {
- first++;
- (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename);
- fp = fopen(fname, "r");
- if (fp != 0)
- goto next;
- (void) snprintf(fname, sizeof fname, "options.%s", machinename);
- goto openit;
- }
- return;
- }
- if (wd == 0)
- goto next;
- if (wd[0] == '#')
- {
- while (((wd = get_word(fp)) != (char *)EOF) && wd)
- ;
- goto next;
- }
- this = ns(wd);
- val = get_word(fp);
- if (val == (char *)EOF)
- return;
- if (val == 0) {
- char *s = ns(this);
- (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s));
- val = genopt;
- free(s);
- } else if (eq(val, "=")) {
- val = get_word(fp);
- if (val == (char *)EOF) {
- printf("%s: unexpected end of file\n", fname);
- exit(1);
- }
- if (val == 0) {
- printf("%s: Expected a right hand side at %s\n", fname,
- this);
- exit(1);
- }
- flags |= OL_ALIAS;
- }
- val = ns(val);
SLIST_FOREACH(po, &otab, o_next) {
if (eq(po->o_name, this)) {
@@ -366,16 +303,101 @@ next:
exit(1);
}
}
-
+}
+
+static void
+insert_option(const char *fname, char *this, char *val)
+{
+ struct opt_list *po;
+
+ check_duplicate(fname, this);
po = (struct opt_list *) calloc(1, sizeof *po);
if (po == NULL)
err(EXIT_FAILURE, "calloc");
po->o_name = this;
po->o_file = val;
- po->o_flags = flags;
+ po->o_flags = 0;
SLIST_INSERT_HEAD(&otab, po, o_next);
+}
- goto next;
+static void
+update_option(const char *this, char *val, int flags)
+{
+ struct opt_list *po;
+
+ SLIST_FOREACH(po, &otab, o_next) {
+ if (eq(po->o_name, this)) {
+ free(po->o_file);
+ po->o_file = val;
+ po->o_flags = flags;
+ return;
+ }
+ }
+ printf("Compat option %s not listed in options file.\n", this);
+ exit(1);
+}
+
+static int
+read_option_file(const char *fname, int flags)
+{
+ FILE *fp;
+ char *wd, *this, *val;
+ char genopt[MAXPATHLEN];
+
+ fp = fopen(fname, "r");
+ if (fp == 0)
+ return (0);
+ while ((wd = get_word(fp)) != (char *)EOF) {
+ if (wd == 0)
+ continue;
+ if (wd[0] == '#') {
+ while (((wd = get_word(fp)) != (char *)EOF) && wd)
+ continue;
+ continue;
+ }
+ this = ns(wd);
+ val = get_word(fp);
+ if (val == (char *)EOF)
+ return (1);
+ if (val == 0) {
+ if (flags) {
+ printf("%s: compat file requires two words "
+ "per line at %s\n", fname, this);
+ exit(1);
+ }
+ char *s = ns(this);
+ (void)snprintf(genopt, sizeof(genopt), "opt_%s.h",
+ lower(s));
+ val = genopt;
+ free(s);
+ }
+ val = ns(val);
+ if (flags == 0)
+ insert_option(fname, this, val);
+ else
+ update_option(this, val, flags);
+ }
+ (void)fclose(fp);
+ return (1);
+}
+
+/*
+ * read the options and options.<machine> files
+ */
+static void
+read_options(void)
+{
+ char fname[MAXPATHLEN];
+
+ SLIST_INIT(&otab);
+ read_option_file("../../conf/options", 0);
+ (void)snprintf(fname, sizeof fname, "../../conf/options.%s",
+ machinename);
+ if (!read_option_file(fname, 0)) {
+ (void)snprintf(fname, sizeof fname, "options.%s", machinename);
+ read_option_file(fname, 0);
+ }
+ read_option_file("../../conf/options-compat", OL_ALIAS);
}
static char *
diff --git a/usr.sbin/cxgbtool/cxgbtool.c b/usr.sbin/cxgbtool/cxgbtool.c
index 28d91f9..b705ff8 100644
--- a/usr.sbin/cxgbtool/cxgbtool.c
+++ b/usr.sbin/cxgbtool/cxgbtool.c
@@ -1,6 +1,6 @@
/**************************************************************************
-Copyright (c) 2007-2009, Chelsio Inc.
+Copyright (c) 2007-2010, Chelsio Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -93,6 +93,9 @@ usage(FILE *fp)
"\tclearstats clear MAC statistics\n"
"\tcontext <type> <id> show an SGE context\n"
"\tdesc <qset> <queue> <idx> [<cnt>] dump SGE descriptors\n"
+ "\tfilter <idx> [<param> <val>] ... set a filter\n"
+ "\tfilter <idx> delete|clear delete a filter\n"
+ "\tfilter list list all filters\n"
"\tioqs dump uP IOQs\n"
"\tla dump uP logic analyzer info\n"
"\tloadboot <boot image> download boot image\n"
@@ -1177,24 +1180,25 @@ parse_ipaddr(const char *s, uint32_t *addr, uint32_t *mask)
* Parse a string containing a value and an optional colon separated mask.
*/
static int
-parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask)
+parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask,
+ uint32_t default_mask)
{
char *p;
- *mask = 0xffffffffU;
+ *mask = default_mask;
*val = strtoul(s, &p, 0);
- if (p == s)
+ if (p == s || *val > default_mask)
return -1;
if (*p == ':' && p[1])
*mask = strtoul(p + 1, &p, 0);
- return *p ? -1 : 0;
+ return *p || *mask > default_mask ? -1 : 0;
}
static int
parse_trace_param(const char *s, uint32_t *val, uint32_t *mask)
{
return strchr(s, '.') ? parse_ipaddr(s, val, mask) :
- parse_val_mask_param(s, val, mask);
+ parse_val_mask_param(s, val, mask, 0xffffffffU);
}
static int
@@ -1273,6 +1277,174 @@ trace_config(int argc, char *argv[], int start_arg, const char *iff_name)
return 0;
}
+static void
+show_filters(const char *iff_name)
+{
+ static const char *pkt_type[] = { "*", "tcp", "udp", "frag" };
+ struct ch_filter op;
+ union {
+ uint32_t nip;
+ uint8_t octet[4];
+ } nsip, ndip;
+ char sip[20], dip[20];
+ int header = 0;
+
+ bzero(&op, sizeof(op));
+ op.filter_id = 0xffffffff;
+
+ do {
+ if (doit(iff_name, CHELSIO_GET_FILTER, &op) < 0)
+ err(1, "list filters");
+
+ if (op.filter_id == 0xffffffff)
+ break;
+
+ if (!header) {
+ printf("index SIP DIP sport "
+ "dport VLAN PRI P/MAC type Q\n");
+ header = 1;
+ }
+
+ nsip.nip = htonl(op.val.sip);
+ ndip.nip = htonl(op.val.dip);
+
+ sprintf(sip, "%u.%u.%u.%u/%-2u", nsip.octet[0], nsip.octet[1],
+ nsip.octet[2], nsip.octet[3],
+ op.mask.sip ? 33 - ffs(op.mask.sip) : 0);
+ sprintf(dip, "%u.%u.%u.%u", ndip.octet[0], ndip.octet[1],
+ ndip.octet[2], ndip.octet[3]);
+ printf("%5zu %18s %15s ", (size_t)op.filter_id, sip, dip);
+ printf(op.val.sport ? "%5u " : " * ", op.val.sport);
+ printf(op.val.dport ? "%5u " : " * ", op.val.dport);
+ printf(op.val.vlan != 0xfff ? "%4u " : " * ", op.val.vlan);
+ printf(op.val.vlan_prio == 7 ? " * " :
+ "%1u/%1u ", op.val.vlan_prio, op.val.vlan_prio | 1);
+ if (op.mac_addr_idx == 0xffff)
+ printf("*/* ");
+ else if (op.mac_hit)
+ printf("%1u/%3u ", (op.mac_addr_idx >> 3) & 0x1,
+ (op.mac_addr_idx) & 0x7);
+ else
+ printf("%1u/ * ", (op.mac_addr_idx >> 3) & 0x1);
+ printf("%4s ", pkt_type[op.proto]);
+ if (!op.pass)
+ printf("-\n");
+ else if (op.rss)
+ printf("*\n");
+ else
+ printf("%1u\n", op.qset);
+ } while (1);
+}
+
+static int
+filter_config(int argc, char *argv[], int start_arg, const char *iff_name)
+{
+ int ret = 0;
+ uint32_t val, mask;
+ struct ch_filter op;
+
+ if (argc < start_arg + 1)
+ return -1;
+
+ memset(&op, 0, sizeof(op));
+ op.mac_addr_idx = 0xffff;
+ op.rss = 1;
+
+ if (argc == start_arg + 1 && !strcmp(argv[start_arg], "list")) {
+ show_filters(iff_name);
+ return 0;
+ }
+
+ if (get_int_arg(argv[start_arg++], &op.filter_id))
+ return -1;
+ if (argc == start_arg + 1 && (!strcmp(argv[start_arg], "delete") ||
+ !strcmp(argv[start_arg], "clear"))) {
+ if (doit(iff_name, CHELSIO_DEL_FILTER, &op) < 0) {
+ if (errno == EBUSY)
+ err(1, "no filter support when offload in use");
+ err(1, "delete filter");
+ }
+ return 0;
+ }
+
+ while (start_arg + 2 <= argc) {
+ if (!strcmp(argv[start_arg], "sip")) {
+ ret = parse_ipaddr(argv[start_arg + 1], &op.val.sip,
+ &op.mask.sip);
+ } else if (!strcmp(argv[start_arg], "dip")) {
+ ret = parse_ipaddr(argv[start_arg + 1], &op.val.dip,
+ &op.mask.dip);
+ } else if (!strcmp(argv[start_arg], "sport")) {
+ ret = parse_val_mask_param(argv[start_arg + 1],
+ &val, &mask, 0xffff);
+ op.val.sport = val;
+ op.mask.sport = mask;
+ } else if (!strcmp(argv[start_arg], "dport")) {
+ ret = parse_val_mask_param(argv[start_arg + 1],
+ &val, &mask, 0xffff);
+ op.val.dport = val;
+ op.mask.dport = mask;
+ } else if (!strcmp(argv[start_arg], "vlan")) {
+ ret = parse_val_mask_param(argv[start_arg + 1],
+ &val, &mask, 0xfff);
+ op.val.vlan = val;
+ op.mask.vlan = mask;
+ } else if (!strcmp(argv[start_arg], "prio")) {
+ ret = parse_val_mask_param(argv[start_arg + 1],
+ &val, &mask, 7);
+ op.val.vlan_prio = val;
+ op.mask.vlan_prio = mask;
+ } else if (!strcmp(argv[start_arg], "mac")) {
+ if (!strcmp(argv[start_arg + 1], "none"))
+ val = -1;
+ else
+ ret = get_int_arg(argv[start_arg + 1], &val);
+ op.mac_hit = val != (uint32_t)-1;
+ op.mac_addr_idx = op.mac_hit ? val : 0;
+ } else if (!strcmp(argv[start_arg], "type")) {
+ if (!strcmp(argv[start_arg + 1], "tcp"))
+ op.proto = 1;
+ else if (!strcmp(argv[start_arg + 1], "udp"))
+ op.proto = 2;
+ else if (!strcmp(argv[start_arg + 1], "frag"))
+ op.proto = 3;
+ else
+ errx(1, "unknown type \"%s\"; must be one of "
+ "\"tcp\", \"udp\", or \"frag\"",
+ argv[start_arg + 1]);
+ } else if (!strcmp(argv[start_arg], "queue")) {
+ ret = get_int_arg(argv[start_arg + 1], &val);
+ op.qset = val;
+ op.rss = 0;
+ } else if (!strcmp(argv[start_arg], "action")) {
+ if (!strcmp(argv[start_arg + 1], "pass"))
+ op.pass = 1;
+ else if (strcmp(argv[start_arg + 1], "drop"))
+ errx(1, "unknown action \"%s\"; must be one of "
+ "\"pass\" or \"drop\"",
+ argv[start_arg + 1]);
+ } else
+ errx(1, "unknown filter parameter \"%s\"\n"
+ "known parameters are \"mac\", \"sip\", "
+ "\"dip\", \"sport\", \"dport\", \"vlan\", "
+ "\"prio\", \"type\", \"queue\", and \"action\"",
+ argv[start_arg]);
+ if (ret < 0)
+ errx(1, "bad value \"%s\" for parameter \"%s\"",
+ argv[start_arg + 1], argv[start_arg]);
+ start_arg += 2;
+ }
+ if (start_arg != argc)
+ errx(1, "no value for \"%s\"", argv[start_arg]);
+
+ if (doit(iff_name, CHELSIO_SET_FILTER, &op) < 0) {
+ if (errno == EBUSY)
+ err(1, "no filter support when offload in use");
+ err(1, "set filter");
+ }
+
+ return 0;
+}
static int
get_sched_param(int argc, char *argv[], int pos, unsigned int *valp)
{
@@ -1501,6 +1673,8 @@ run_cmd(int argc, char *argv[], const char *iff_name)
r = pktsched(argc, argv, 3, iff_name);
else if (!strcmp(argv[2], "tcb"))
r = get_tcb2(argc, argv, 3, iff_name);
+ else if (!strcmp(argv[2], "filter"))
+ r = filter_config(argc, argv, 3, iff_name);
else if (!strcmp(argv[2], "clearstats"))
r = clear_stats(argc, argv, 3, iff_name);
else if (!strcmp(argv[2], "la"))
diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8
index 85fe988..8e49b07 100644
--- a/usr.sbin/jail/jail.8
+++ b/usr.sbin/jail/jail.8
@@ -239,7 +239,7 @@ The
.Xr jexec 8 .
.It Va ip4.addr
A comma-separated list of IPv4 addresses assigned to the prison.
-If this is set, the jail is restricted to using only these address.
+If this is set, the jail is restricted to using only these addresses.
Any attempts to use other addresses fail, and attempts to use wildcard
addresses silently use the jailed address instead.
For IPv4 the first address given will be kept used as the source address
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh
index 7f06968..84ee455 100755
--- a/usr.sbin/mergemaster/mergemaster.sh
+++ b/usr.sbin/mergemaster/mergemaster.sh
@@ -849,6 +849,9 @@ mm_install () {
/etc/login.conf)
NEED_CAP_MKDB=yes
;;
+ /etc/services)
+ NEED_SERVICES_MKDB=yes
+ ;;
/etc/master.passwd)
do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}"
NEED_PWD_MKDB=yes
@@ -1278,6 +1281,17 @@ case "${NEED_CAP_MKDB}" in
;;
esac
+case "${NEED_SERVICES_MKDB}" in
+'') ;;
+*)
+ echo ''
+ echo "*** You installed a services file, so make sure that you run"
+ echo " '/usr/sbin/services_mkdb -q -o ${DESTDIR}/var/db/services.db ${DESTDIR}/etc/services'"
+ echo " to rebuild your services database"
+ run_it_now "/usr/sbin/services_mkdb -q -o ${DESTDIR}/var/db/services.db ${DESTDIR}/etc/services"
+ ;;
+esac
+
case "${NEED_PWD_MKDB}" in
'') ;;
*)
OpenPOWER on IntegriCloud