aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/bsdlabel.82
-rw-r--r--sbin/bsdlabel/bsdlabel.c2
-rw-r--r--sbin/devd/snd.conf5
-rw-r--r--sbin/dumpon/dumpon.819
-rw-r--r--sbin/fdisk/fdisk.84
-rw-r--r--sbin/fdisk/fdisk.c2
-rw-r--r--sbin/fsck_ffs/setup.c47
-rw-r--r--sbin/geom/Makefile2
-rw-r--r--sbin/geom/core/geom.c254
-rw-r--r--sbin/ifconfig/ifbridge.c8
-rw-r--r--sbin/ifconfig/ifconfig.87
-rw-r--r--sbin/ipf/ipfs/ipfs.c2
-rw-r--r--sbin/ipf/libipf/interror.c6
-rw-r--r--sbin/ipfw/dummynet.c4
-rw-r--r--sbin/ipfw/ipfw2.c8
-rw-r--r--sbin/ipfw/tables.c3
-rwxr-xr-xsbin/mdconfig/tests/mdconfig_test.sh15
-rw-r--r--sbin/mount/mount.83
-rw-r--r--sbin/nvmecontrol/perftest.c2
-rw-r--r--sbin/pfctl/parse.y2
-rw-r--r--sbin/pfctl/pfctl.c11
-rw-r--r--sbin/pfctl/pfctl.h2
-rw-r--r--sbin/pfctl/pfctl_radix.c6
-rw-r--r--sbin/pfctl/pfctl_table.c13
-rw-r--r--sbin/ping/tests/Makefile3
25 files changed, 250 insertions, 182 deletions
diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8
index abea59756aea..cdf3cc249856 100644
--- a/sbin/bsdlabel/bsdlabel.8
+++ b/sbin/bsdlabel/bsdlabel.8
@@ -62,7 +62,7 @@
.Sh DEPRECATION NOTICE
.Nm
is deprecated and is not available in
-.Fx 15.0
+.Fx 16.0
or later.
Use
.Xr gpart 8
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index a68ee377a97c..912833ec12e3 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -136,7 +136,7 @@ main(int argc, char *argv[])
name = NULL;
fprintf(stderr,
- "WARNING: bsdlabel is deprecated and is not available in FreeBSD 15 or later.\n"
+ "WARNING: bsdlabel is deprecated and is not available in FreeBSD 16 or later.\n"
"Please use gpart instead.\n\n");
while ((ch = getopt(argc, argv, "ABb:efm:nRrw")) != -1)
diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf
index cf9cd9e94191..a45f427f6c79 100644
--- a/sbin/devd/snd.conf
+++ b/sbin/devd/snd.conf
@@ -5,6 +5,9 @@ notify 0 {
match "type" "IN";
match "cdev" "dsp[0-9]+";
+ # Other audio servers or device switching commands can be used here
+ # instead of virtual_oss(8).
+ #
# FIXME: We are hardcoding /dev/vdsp.ctl here, simply because it is a
# common virtual_oss control device name. Until we find a proper way to
# define control devices here, /dev/vdsp.ctl can be changed to the
@@ -18,6 +21,6 @@ notify 0 {
match "type" "OUT";
match "cdev" "dsp[0-9]+";
- # FIXME: See comment above.
+ # See comment above.
action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -P /dev/$cdev";
};
diff --git a/sbin/dumpon/dumpon.8 b/sbin/dumpon/dumpon.8
index a57dfef7096d..4e4abb8d4b79 100644
--- a/sbin/dumpon/dumpon.8
+++ b/sbin/dumpon/dumpon.8
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 23, 2020
+.Dd November 6, 2025
.Dt DUMPON 8
.Os
.Sh NAME
@@ -228,6 +228,20 @@ total amount of physical memory as reported by the
.Va hw.physmem
.Xr sysctl 8
variable.
+.Sh SYSCTL VARIABLES
+The following
+.Xr sysctl 8
+variables can be used to modify or monitor the behavior of crash dumps:
+.Bl -tag -width "machdep.dump_retry_count"
+.It Va debug.minidump
+Set the type of kernel crash dump.
+Possible values are 0 for a full crash dump or 1 for a minidump.
+The default is minidump.
+.It Va machdep.dump_retry_count
+The maximum number of times dump will retry before giving up.
+The default value is 5.
+This sysctl is only supported on PowerPC and AMD64.
+.El
.Sh IMPLEMENTATION NOTES
Because the file system layer is already dead by the time a crash dump
is taken, it is not possible to send crash dumps directly to a file.
@@ -339,7 +353,7 @@ when
binds to a server,
.Xr dhclient-script 8
can be used to run
-.Xr dumpon 8 .
+.Nm .
For example, to automatically configure
.Xr netdump 4
on the vtnet0 interface, add the following to
@@ -377,6 +391,7 @@ needed.
.Xr loader 8 ,
.Xr rc 8 ,
.Xr savecore 8 ,
+.Xr sysctl 8 ,
.Xr swapon 8 ,
.Xr panic 9
.Sh HISTORY
diff --git a/sbin/fdisk/fdisk.8 b/sbin/fdisk/fdisk.8
index 09933acf57df..f26e6bb67d6e 100644
--- a/sbin/fdisk/fdisk.8
+++ b/sbin/fdisk/fdisk.8
@@ -1,5 +1,5 @@
.\"
-.Dd October 5, 2016
+.Dd October 24, 2025
.Dt FDISK 8
.Os
.Sh NAME
@@ -18,7 +18,7 @@
.Sh DEPRECATION NOTICE
.Nm
is deprecated and is not available in
-.Fx 15.0
+.Fx 16.0
or later.
Use
.Xr gpart 8
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 925cc68932d7..28230191bb16 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -266,7 +266,7 @@ main(int argc, char *argv[])
struct dos_partition *partp;
fprintf(stderr,
- "WARNING: fdisk is deprecated and is not available in FreeBSD 15 or later.\n"
+ "WARNING: fdisk is deprecated and is not available in FreeBSD 16 or later.\n"
"Please use gpart instead.\n\n");
while ((c = getopt(argc, argv, "BIab:f:ipqstuv1234")) != -1)
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index f10f02d159c3..41b4a5336350 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -58,7 +58,6 @@ char *copybuf; /* buffer to copy snapshot blocks */
static int sbhashfailed;
#define POWEROF2(num) (((num) & ((num) - 1)) == 0)
-static int calcsb(char *dev, int devfd, struct fs *fs);
static void saverecovery(int readfd, int writefd);
static int chkrecovery(int devfd);
static int getlbnblkno(struct inodesc *);
@@ -501,52 +500,6 @@ sblock_init(void)
}
/*
- * Calculate a prototype superblock based on information in the boot area.
- * When done the cgsblock macro can be calculated and the fs_ncg field
- * can be used. Do NOT attempt to use other macros without verifying that
- * their needed information is available!
- */
-static int
-calcsb(char *dev, int devfd, struct fs *fs)
-{
- struct fsrecovery *fsr;
- char *fsrbuf;
- u_int secsize;
-
- /*
- * We need fragments-per-group and the partition-size.
- *
- * Newfs stores these details at the end of the boot block area
- * at the start of the filesystem partition. If they have been
- * overwritten by a boot block, we fail. But usually they are
- * there and we can use them.
- */
- if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1)
- return (0);
- fsrbuf = Balloc(secsize);
- if (fsrbuf == NULL)
- errx(EEXIT, "calcsb: cannot allocate recovery buffer");
- if (blread(devfd, fsrbuf,
- (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) {
- free(fsrbuf);
- return (0);
- }
- fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr];
- if (fsr->fsr_magic != FS_UFS2_MAGIC) {
- free(fsrbuf);
- return (0);
- }
- memset(fs, 0, sizeof(struct fs));
- fs->fs_fpg = fsr->fsr_fpg;
- fs->fs_fsbtodb = fsr->fsr_fsbtodb;
- fs->fs_sblkno = fsr->fsr_sblkno;
- fs->fs_magic = fsr->fsr_magic;
- fs->fs_ncg = fsr->fsr_ncg;
- free(fsrbuf);
- return (1);
-}
-
-/*
* Check to see if recovery information exists.
* Return 1 if it exists or cannot be created.
* Return 0 if it does not exist and can be created.
diff --git a/sbin/geom/Makefile b/sbin/geom/Makefile
index 078503d3ae67..61561ef1ff1b 100644
--- a/sbin/geom/Makefile
+++ b/sbin/geom/Makefile
@@ -9,7 +9,7 @@ MAN= geom.8
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/core
CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\"
-LIBADD= geom util
+LIBADD= geom util xo
.if defined(RESCUE)
.PATH: ${SRCTOP}/lib/geom/part \
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c
index b78021194ddd..51ea52a3e858 100644
--- a/sbin/geom/core/geom.c
+++ b/sbin/geom/core/geom.c
@@ -49,9 +49,12 @@
#include <assert.h>
#include <libgeom.h>
#include <geom.h>
+#include <libxo/xo.h>
#include "misc/subr.h"
+#define GEOM_XO_VERSION "1"
+
#ifdef STATIC_GEOM_CLASSES
extern uint32_t gpart_version;
extern struct g_command gpart_class_commands[];
@@ -513,6 +516,7 @@ run_command(int argc, char *argv[])
gctl_free(req);
if (verbose)
printf("Done.\n");
+ xo_finish();
exit(EXIT_SUCCESS);
}
@@ -810,6 +814,10 @@ main(int argc, char *argv[])
provider_name = NULL;
tflag = false;
+ argc = xo_parse_args(argc, argv);
+ if (argc < 0)
+ return (argc);
+
if (strcmp(getprogname(), "geom") == 0) {
while ((ch = getopt(argc, argv, "hp:t")) != -1) {
switch (ch) {
@@ -831,6 +839,7 @@ main(int argc, char *argv[])
* Don't adjust argc and argv, it would break get_class().
*/
}
+ xo_set_version(GEOM_XO_VERSION);
if (tflag && provider_name != NULL) {
errx(EXIT_FAILURE,
@@ -839,6 +848,7 @@ main(int argc, char *argv[])
if (provider_name != NULL) {
list_one_geom_by_provider(provider_name);
+ xo_finish();
return (0);
}
@@ -882,29 +892,33 @@ find_geom(struct gclass *classp, const char *name)
}
static void
-list_one_provider(struct gprovider *pp, const char *prefix)
+list_one_provider(struct gprovider *pp, const char *padding)
{
struct gconfig *conf;
char buf[5];
- printf("Name: %s\n", pp->lg_name);
+ xo_emit("{Lcw:Name}{:name}\n", pp->lg_name);
humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "",
HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
- printf("%sMediasize: %jd (%s)\n", prefix, (intmax_t)pp->lg_mediasize,
- buf);
- printf("%sSectorsize: %u\n", prefix, pp->lg_sectorsize);
+ xo_emit("{P:/%s}{Lcw:Mediasize}{:mediasize/%jd} ({N:/%s})\n",
+ padding, (intmax_t)pp->lg_mediasize, buf);
+ xo_emit("{P:/%s}{Lcw:Sectorsize}{:sectorsize/%u}\n",
+ padding, pp->lg_sectorsize);
if (pp->lg_stripesize > 0 || pp->lg_stripeoffset > 0) {
- printf("%sStripesize: %ju\n", prefix, pp->lg_stripesize);
- printf("%sStripeoffset: %ju\n", prefix, pp->lg_stripeoffset);
+ xo_emit("{P:/%s}{Lcw:Stripesize}{:stripesize/%ju}\n",
+ padding, pp->lg_stripesize);
+ xo_emit("{P:/%s}{Lcw:Stripeoffset}{:stripeoffset/%ju}\n",
+ padding, pp->lg_stripeoffset);
}
- printf("%sMode: %s\n", prefix, pp->lg_mode);
+ xo_emit("{P:/%s}{Lcw:Mode}{:mode}\n", padding, pp->lg_mode);
LIST_FOREACH(conf, &pp->lg_config, lg_config) {
- printf("%s%s: %s\n", prefix, conf->lg_name, conf->lg_val);
+ xo_emit("{P:/%s}{Lcwa:}{a:}\n", padding, conf->lg_name,
+ conf->lg_name, conf->lg_val ? conf->lg_val : "");
}
}
static void
-list_one_consumer(struct gconsumer *cp, const char *prefix)
+list_one_consumer(struct gconsumer *cp, const char *padding)
{
struct gprovider *pp;
struct gconfig *conf;
@@ -915,20 +929,24 @@ list_one_consumer(struct gconsumer *cp, const char *prefix)
else {
char buf[5];
- printf("Name: %s\n", pp->lg_name);
+ xo_emit("{Lcw:Name}{:name}\n", pp->lg_name);
humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "",
HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
- printf("%sMediasize: %jd (%s)\n", prefix,
- (intmax_t)pp->lg_mediasize, buf);
- printf("%sSectorsize: %u\n", prefix, pp->lg_sectorsize);
+ xo_emit("{P:/%s}{Lcw:Mediasize}{:mediasize/%jd} ({N:/%s})\n",
+ padding, (intmax_t)pp->lg_mediasize, buf);
+ xo_emit("{P:/%s}{Lcw:Sectorsize}{:sectorsize/%u}\n",
+ padding, pp->lg_sectorsize);
if (pp->lg_stripesize > 0 || pp->lg_stripeoffset > 0) {
- printf("%sStripesize: %ju\n", prefix, pp->lg_stripesize);
- printf("%sStripeoffset: %ju\n", prefix, pp->lg_stripeoffset);
+ xo_emit("{P:/%s}{Lcw:Stripesize}{:stripesize/%ju}\n",
+ padding, pp->lg_stripesize);
+ xo_emit("{P:/%s}{Lcw:Stripeoffset}{:stripeoffset/%ju}\n",
+ padding, pp->lg_stripeoffset);
}
- printf("%sMode: %s\n", prefix, cp->lg_mode);
+ xo_emit("{P:/%s}{Lcw:Mode}{:mode}\n", padding, pp->lg_mode);
}
LIST_FOREACH(conf, &cp->lg_config, lg_config) {
- printf("%s%s: %s\n", prefix, conf->lg_name, conf->lg_val);
+ xo_emit("{P:/%s}{Lcwa:}{a:}\n", padding, conf->lg_name,
+ conf->lg_name, conf->lg_val ? conf->lg_val : "");
}
}
@@ -940,27 +958,36 @@ list_one_geom(struct ggeom *gp)
struct gconfig *conf;
unsigned n;
- printf("Geom name: %s\n", gp->lg_name);
+ xo_emit("{Lcw:Geom name}{:name}\n", gp->lg_name);
LIST_FOREACH(conf, &gp->lg_config, lg_config) {
- printf("%s: %s\n", conf->lg_name, conf->lg_val);
+ xo_emit("{Lcwa:}{a:}\n", conf->lg_name, conf->lg_name,
+ conf->lg_val ? conf->lg_val : "");
}
if (!LIST_EMPTY(&gp->lg_provider)) {
- printf("Providers:\n");
+ xo_open_list("providers");
+ xo_emit("{Tc:Providers}\n");
n = 1;
LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
- printf("%u. ", n++);
+ xo_emit("{T:/%u}. ", n++);
+ xo_open_instance("provider");
list_one_provider(pp, " ");
+ xo_close_instance("provider");
}
+ xo_close_list("providers");
}
if (!LIST_EMPTY(&gp->lg_consumer)) {
- printf("Consumers:\n");
+ xo_open_list("consumers");
+ xo_emit("{Tc:Consumers}\n");
n = 1;
LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) {
- printf("%u. ", n++);
+ xo_emit("{T:/%u}. ", n++);
+ xo_open_instance("consumer");
list_one_consumer(cp, " ");
+ xo_close_instance("consumer");
}
+ xo_close_list("consumers");
}
- printf("\n");
+ xo_emit("\n");
}
static void
@@ -978,8 +1005,10 @@ list_one_geom_by_provider(const char *provider_name)
if (gp == NULL)
errx(EXIT_FAILURE, "Cannot find provider '%s'.", provider_name);
- printf("Geom class: %s\n", gp->lg_class->lg_name);
+ xo_open_container(provider_name);
+ xo_emit("{Lwc:Geom class}{:class}\n", gp->lg_class->lg_name);
list_one_geom(gp);
+ xo_close_container(provider_name);
}
static void
@@ -1038,14 +1067,20 @@ std_list(struct gctl_req *req, unsigned flags __unused)
"an instance named '%s'.",
gclass_name, name);
}
+ xo_open_container(gclass_name);
list_one_geom(gp);
+ xo_close_container(gclass_name);
}
} else {
+ xo_open_list(gclass_name);
LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
if (LIST_EMPTY(&gp->lg_provider) && !all)
continue;
+ xo_open_instance("geom");
list_one_geom(gp);
+ xo_close_instance("geom");
}
+ xo_close_list(gclass_name);
}
geom_deletetree(&mesh);
}
@@ -1115,34 +1150,24 @@ status_update_len_prs(struct ggeom *gp, int *name_len, int *status_len)
}
static char *
-status_one_consumer(struct gconsumer *cp)
+status_one_consumer(struct gconsumer *cp, const char *value)
{
- static char buf[256];
struct gprovider *pp;
struct gconfig *conf;
- const char *state, *syncr;
+ char *ret;
pp = cp->lg_provider;
if (pp == NULL)
return (NULL);
- state = NULL;
- syncr = NULL;
+ ret = NULL;
LIST_FOREACH(conf, &cp->lg_config, lg_config) {
- if (strcasecmp(conf->lg_name, "state") == 0)
- state = conf->lg_val;
- if (strcasecmp(conf->lg_name, "synchronized") == 0)
- syncr = conf->lg_val;
- }
- if (state == NULL && syncr == NULL)
- snprintf(buf, sizeof(buf), "%s", pp->lg_name);
- else if (state != NULL && syncr != NULL) {
- snprintf(buf, sizeof(buf), "%s (%s, %s)", pp->lg_name,
- state, syncr);
- } else {
- snprintf(buf, sizeof(buf), "%s (%s)", pp->lg_name,
- state ? state : syncr);
+ if (strcasecmp(conf->lg_name, value) == 0)
+ ret = conf->lg_val;
}
- return (buf);
+
+ if (ret == NULL)
+ return (NULL);
+ return (ret);
}
static void
@@ -1150,8 +1175,9 @@ status_one_geom(struct ggeom *gp, int script, int name_len, int status_len)
{
struct gconsumer *cp;
struct gconfig *conf;
- const char *name, *status, *component;
- int gotone;
+ char fmt[64];
+ const char *name, *status, *cstate, *csyncr;
+ int gotone, len;
name = gp->lg_name;
status = "N/A";
@@ -1161,21 +1187,59 @@ status_one_geom(struct ggeom *gp, int script, int name_len, int status_len)
break;
}
}
- gotone = 0;
+ gotone = len = 0;
+ xo_open_instance("status");
LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) {
- component = status_one_consumer(cp);
- if (component == NULL)
+ if (cp->lg_provider == NULL)
continue;
+
+ cstate = status_one_consumer(cp, "state");
+ csyncr = status_one_consumer(cp, "synchronized");
+ if (!gotone || script) {
+ if (!gotone) {
+ xo_emit("{t:name/%*s} {t:status/%*s} ",
+ name_len, name, status_len, status);
+ xo_open_list("components");
+ } else {
+ /*
+ * XXX: running the same xo_emit() as above or
+ * variations of it will cause the XML/JSON to
+ * produce extra "components" lists in script
+ * mode
+ */
+
+ snprintf(fmt, sizeof(fmt), "%*s %*s ",
+ name_len, name, status_len, status);
+ xo_emit(fmt);
+ }
+ }
+
+ xo_open_instance("components");
+ if (cstate != NULL && csyncr != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:state}, {:synchronized})\n",
+ len, "", cp->lg_provider->lg_name, cstate, csyncr);
+ } else if (cstate != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:state})\n",
+ len, "", cp->lg_provider->lg_name, cstate);
+ } else if (csyncr != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:synchronized})\n",
+ len, "", cp->lg_provider->lg_name, csyncr);
+ } else {
+ xo_emit("{P:/%*s}{:component}\n",
+ len, "", cp->lg_provider->lg_name);
+ }
+ xo_close_instance("components");
gotone = 1;
- printf("%*s %*s %s\n", name_len, name, status_len, status,
- component);
- if (!script)
- name = status = "";
+ if (!len && !script)
+ len = name_len + status_len + 4;
}
if (!gotone) {
- printf("%*s %*s %s\n", name_len, name, status_len, status,
- "N/A");
+ xo_emit("{t:name/%*s} {t:status/%*s} N/A\n",
+ name_len, name, status_len, status);
+ } else {
+ xo_close_list("components");
}
+ xo_close_instance("status");
}
static void
@@ -1184,9 +1248,11 @@ status_one_geom_prs(struct ggeom *gp, int script, int name_len, int status_len)
struct gprovider *pp;
struct gconsumer *cp;
struct gconfig *conf;
- const char *name, *status, *component;
- int gotone;
+ const char *name, *status, *cstate, *csyncr;
+ char fmt[64];
+ int gotone, len;
+ xo_open_instance("status");
LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
name = pp->lg_name;
status = "N/A";
@@ -1202,22 +1268,60 @@ status_one_geom_prs(struct ggeom *gp, int script, int name_len, int status_len)
break;
}
}
- gotone = 0;
+ gotone = len = 0;
LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) {
- component = status_one_consumer(cp);
- if (component == NULL)
+ if (cp->lg_provider == NULL)
continue;
+
+ cstate = status_one_consumer(cp, "state");
+ csyncr = status_one_consumer(cp, "synchronized");
+ if (!gotone || script) {
+ if (!gotone) {
+ xo_emit("{t:name/%*s} {t:status/%*s} ",
+ name_len, name, status_len, status);
+ xo_open_list("components");
+ } else {
+ /*
+ * XXX: running the same xo_emit() as
+ * above or variations of it will
+ * cause the XML/JSON to produce
+ * extra "components" lists in
+ * script mode
+ */
+
+ snprintf(fmt, sizeof(fmt), "%*s %*s ",
+ name_len, name, status_len, status);
+ xo_emit(fmt);
+ }
+ }
+
+ xo_open_instance("component");
+ if (cstate != NULL && csyncr != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:state}, {:synchronized})\n",
+ len, "", cp->lg_provider->lg_name, cstate, csyncr);
+ } else if (cstate != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:state})\n",
+ len, "", cp->lg_provider->lg_name, cstate);
+ } else if (csyncr != NULL) {
+ xo_emit("{P:/%*s}{:component} ({:synchronized})\n",
+ len, "", cp->lg_provider->lg_name, csyncr);
+ } else {
+ xo_emit("{P:/%*s}{:component}\n",
+ len, "", cp->lg_provider->lg_name);
+ }
+ xo_close_instance("component");
gotone = 1;
- printf("%*s %*s %s\n", name_len, name,
- status_len, status, component);
- if (!script)
- name = status = "";
+ if (!len && !script)
+ len = name_len + status_len + 4;
}
if (!gotone) {
- printf("%*s %*s %s\n", name_len, name,
- status_len, status, "N/A");
+ xo_emit("{t:name/%*s} {t:status/%*s} N/A\n",
+ name_len, name, status_len, status);
+ } else {
+ xo_close_list("components");
}
}
+ xo_close_instance("status");
}
static void
@@ -1240,13 +1344,9 @@ std_status(struct gctl_req *req, unsigned flags __unused)
all = gctl_get_int(req, "all");
geoms = gctl_get_int(req, "geoms");
script = gctl_get_int(req, "script");
- if (script) {
- name_len = 0;
- status_len = 0;
- } else {
- name_len = strlen("Name");
- status_len = strlen("Status");
- }
+ name_len = strlen("Name");
+ status_len = strlen("Status");
+
if (nargs > 0) {
for (i = 0, n = 0; i < nargs; i++) {
name = gctl_get_ascii(req, "arg%d", i);
@@ -1282,9 +1382,10 @@ std_status(struct gctl_req *req, unsigned flags __unused)
goto end;
}
if (!script) {
- printf("%*s %*s %s\n", name_len, "Name", status_len, "Status",
- "Components");
+ xo_emit("{T:/%*s} {T:/%*s} {T:Components}\n",
+ name_len, "Name", status_len, "Status");
}
+ xo_open_list(gclass_name);
if (nargs > 0) {
for (i = 0; i < nargs; i++) {
name = gctl_get_ascii(req, "arg%d", i);
@@ -1312,6 +1413,7 @@ std_status(struct gctl_req *req, unsigned flags __unused)
}
}
}
+ xo_close_list(gclass_name);
end:
geom_deletetree(&mesh);
}
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c
index eff443447c13..8bcf4a638adf 100644
--- a/sbin/ifconfig/ifbridge.c
+++ b/sbin/ifconfig/ifbridge.c
@@ -811,7 +811,7 @@ unsetbridge_private(if_ctx *ctx, const char *val, int dummy __unused)
static int
parse_vlans(ifbvlan_set_t *set, const char *str)
{
- char *s, *token;
+ char *s, *free_s, *token;
/* "none" means the empty vlan set */
if (strcmp(str, "none") == 0) {
@@ -829,6 +829,8 @@ parse_vlans(ifbvlan_set_t *set, const char *str)
if ((s = strdup(str)) == NULL)
return (-1);
+ /* Keep the original value of s, since strsep() will modify it */
+ free_s = s;
while ((token = strsep(&s, ",")) != NULL) {
unsigned long first, last;
@@ -856,11 +858,11 @@ parse_vlans(ifbvlan_set_t *set, const char *str)
BRVLAN_SET(set, vlan);
}
- free(s);
+ free(free_s);
return (0);
err:
- free(s);
+ free(free_s);
return (-1);
}
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index fafb77e1ca6c..627b7cd3f9e3 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 12, 2025
+.Dd October 12, 2025
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -630,6 +630,9 @@ This is useful for devices which have multiple physical layer interfaces
.It Cm name Ar name
Set the interface name to
.Ar name .
+The
+.Ar name
+may not be longer than 15 characters.
.It Cm rxcsum , txcsum , rxcsum6 , txcsum6
If the driver supports user-configurable checksum offloading,
enable receive (or transmit) checksum offloading on the interface.
@@ -2799,7 +2802,7 @@ Set the untagged VLAN identifier for an interface.
Frames received on this interface without an 802.1Q tag will be assigned
to this VLAN instead of the default VLAN 0,
and outgoing frames on this VLAN will have their 802.1Q tag removed.
-.It Cm -ifuntagged Ar interface Ar vlan-id
+.It Cm -ifuntagged Ar interface
Clear the untagged VLAN identifier for an interface.
.It Cm defuntagged Ar vlan-id
Enable the
diff --git a/sbin/ipf/ipfs/ipfs.c b/sbin/ipf/ipfs/ipfs.c
index 6225c6e1154d..94c9f70410f2 100644
--- a/sbin/ipf/ipfs/ipfs.c
+++ b/sbin/ipf/ipfs/ipfs.c
@@ -576,7 +576,7 @@ int readnat(int fd, char *file)
in = (nat_save_t *)malloc(ipn.ipn_dsize);
if (in == NULL) {
- fprintf(stderr, "nat:cannot malloc nat save atruct\n");
+ fprintf(stderr, "nat:cannot malloc nat save struct\n");
goto freenathead;
}
diff --git a/sbin/ipf/libipf/interror.c b/sbin/ipf/libipf/interror.c
index 981823ca6bb9..a8dc3be2d5d1 100644
--- a/sbin/ipf/libipf/interror.c
+++ b/sbin/ipf/libipf/interror.c
@@ -17,7 +17,7 @@ typedef struct {
static ipf_error_entry_t *find_error(int);
-#define IPF_NUM_ERRORS 477
+#define IPF_NUM_ERRORS sizeof(ipf_errors) / sizeof(ipf_error_entry_t)
/*
* NO REUSE OF NUMBERS!
@@ -25,7 +25,7 @@ static ipf_error_entry_t *find_error(int);
* IF YOU WANT TO ADD AN ERROR TO THIS TABLE, _ADD_ A NEW NUMBER.
* DO _NOT_ USE AN EMPTY NUMBER OR FILL IN A GAP.
*/
-static ipf_error_entry_t ipf_errors[IPF_NUM_ERRORS] = {
+static ipf_error_entry_t ipf_errors[] = {
{ 1, "auth table locked/full" },
{ 2, "" },
{ 3, "copyinptr received bad address" },
@@ -228,6 +228,8 @@ static ipf_error_entry_t ipf_errors[IPF_NUM_ERRORS] = {
{ 30024, "object size incorrect for hash table" },
{ 30025, "hash table size must be at least 1"},
{ 30026, "cannot allocate memory for hash table context" },
+ { 30027, "hash table larger than maximum allowed" },
+ { 30028, "hash table multiplication overflow" },
/* -------------------------------------------------------------------------- */
{ 40001, "invalid minor device number for log read" },
{ 40002, "read size too small" },
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index 6714b2af3124..a0cefcffd183 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -680,7 +680,7 @@ ipfw_delete_pipe(int do_pipe, int i)
i = do_cmd(IP_DUMMYNET3, &cmd, cmd.oid.len);
if (i) {
i = 1;
- warn("rule %u: setsockopt(IP_DUMMYNET_DEL)", i);
+ warn("rule %u: setsockopt(IP_DUMMYNET3)", i);
}
return i;
}
@@ -1863,7 +1863,7 @@ end_mask:
i = do_cmd(IP_DUMMYNET3, base, (char *)buf - (char *)base);
if (i)
- err(1, "setsockopt(%s)", "IP_DUMMYNET_CONFIGURE");
+ err(1, "setsockopt(%s)", "IP_DUMMYNET3");
}
void
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 2addc0295f0f..27ccaea2c78f 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -648,11 +648,7 @@ do_cmd(int optname, void *optval, uintptr_t optlen)
if (ipfw_socket < 0)
err(EX_UNAVAILABLE, "socket");
- if (optname == IP_FW_GET || optname == IP_DUMMYNET_GET ||
- optname == IP_FW_ADD || optname == IP_FW3 ||
- optname == IP_FW_NAT_GET_CONFIG ||
- optname < 0 ||
- optname == IP_FW_NAT_GET_LOG) {
+ if (optname == IP_FW3 || optname < 0) {
if (optname < 0)
optname = -optname;
i = getsockopt(ipfw_socket, IPPROTO_IP, optname, optval,
@@ -5802,7 +5798,7 @@ ipfw_add(char *av[])
sz = default_off + sizeof(ipfw_obj_ctlv) + tlen + rlen;
if ((tbuf = calloc(1, sz)) == NULL)
- err(EX_UNAVAILABLE, "malloc() failed for IP_FW_ADD");
+ err(EX_UNAVAILABLE, "malloc() failed for IP_FW_XADD");
op3 = (ip_fw3_opheader *)tbuf;
/* Tables first */
ctlv = (ipfw_obj_ctlv *)(op3 + 1);
diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c
index 7c3b1bb35a01..245c0c9e0399 100644
--- a/sbin/ipfw/tables.c
+++ b/sbin/ipfw/tables.c
@@ -1037,9 +1037,6 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add,
}
}
- /* Get real OS error */
- error = errno;
-
/* Report results back */
ptent = tent_buf;
for (i = 0; i < count; ptent++, i++) {
diff --git a/sbin/mdconfig/tests/mdconfig_test.sh b/sbin/mdconfig/tests/mdconfig_test.sh
index ea87ff5d542d..cc29c188cbd8 100755
--- a/sbin/mdconfig/tests/mdconfig_test.sh
+++ b/sbin/mdconfig/tests/mdconfig_test.sh
@@ -274,22 +274,23 @@ attach_size_rounddown()
attach_size_rounddown_body()
{
local md
- local ss=8192
- local ms=$(($ss + 4096))
- local ms2=$((2 * $ss + 4096))
+ local pgsz=$(pagesize)
+ local ss=$(($pgsz * 2))
+ local ms=$(($ss + $pgsz))
+ local ms2=$((2 * $ss + $pgsz))
- # Use a sector size that's a likely multiple of PAGE_SIZE, as md(4)
+ # Use a sector size that's a multiple of the kernel page size, as md(4)
# expects that for swap MDs.
atf_check -s exit:0 -o save:mdconfig.out -e empty \
-x "mdconfig -a -t swap -S $ss -s ${ms}b"
md=$(cat mdconfig.out)
- # 12288 bytes should be rounded down to one sector.
- check_diskinfo "$md" 8192 1 $ss
+ # one sector plus one page should be rounded down to one sector.
+ check_diskinfo "$md" $ss 1 $ss
# Resize and verify that the new size was also rounded down.
atf_check -s exit:0 -o empty -e empty \
-x "mdconfig -r -u ${md#md} -s ${ms2}b"
- check_diskinfo "$md" 16384 2 $ss
+ check_diskinfo "$md" $((2 * $ss)) 2 $ss
}
attach_size_rounddown_cleanup()
{
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index 7bfc21ea41d5..154ad293aee4 100644
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 16, 2025
+.Dd October 28, 2025
.Dt MOUNT 8
.Os
.Sh NAME
@@ -568,6 +568,7 @@ support for a particular file system might be provided either on a static
.Xr kldload 8 ) .
.Sh SEE ALSO
.Xr getfacl 1 ,
+.Xr lsvfs 1 ,
.Xr setfacl 1 ,
.Xr nmount 2 ,
.Xr acl 3 ,
diff --git a/sbin/nvmecontrol/perftest.c b/sbin/nvmecontrol/perftest.c
index 59439d3ed2a9..da75afc64d8d 100644
--- a/sbin/nvmecontrol/perftest.c
+++ b/sbin/nvmecontrol/perftest.c
@@ -171,7 +171,7 @@ perftest(const struct cmd *f, int argc, char *argv[])
arg_help(argc, argv, f);
}
if (opt.time == 0) {
- fprintf(stderr, "No time speciifed\n");
+ fprintf(stderr, "No time specified\n");
arg_help(argc, argv, f);
}
io_test.time = opt.time;
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 0f7702fc4630..127e2c257d69 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -6246,7 +6246,7 @@ check_binat_redirspec(struct node_host *src_host, struct pfctl_rule *r,
}
if (PF_AZERO(&r->src.addr.v.a.mask, af) ||
PF_AZERO(&(nat_pool->addr.v.a.mask), af)) {
- yyerror ("source and redir addresess must have "
+ yyerror ("source and redir addresses must have "
"a matching network mask in binat-rule");
error++;
}
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index ed317495c2e0..02d6c9c84a32 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -2618,6 +2618,8 @@ pfctl_apply_limit(struct pfctl *pf, const char *opt, unsigned int limit)
int
pfctl_load_limit(struct pfctl *pf, unsigned int index, unsigned int limit)
{
+ static int restore_limit_handler_armed = 0;
+
if (pfctl_set_limit(pf->h, index, limit)) {
if (errno == EBUSY)
warnx("Current pool size exceeds requested %s limit %u",
@@ -2626,6 +2628,9 @@ pfctl_load_limit(struct pfctl *pf, unsigned int index, unsigned int limit)
warnx("Cannot set %s limit to %u",
pf_limits[index].name, limit);
return (1);
+ } else if (restore_limit_handler_armed == 0) {
+ atexit(pfctl_restore_limits);
+ restore_limit_handler_armed = 1;
}
return (0);
}
@@ -3167,10 +3172,7 @@ pfctl_show_eth_anchors(int dev, int opts, char *anchorname)
int ret;
if ((ret = pfctl_get_eth_rulesets_info(dev, &ri, anchorname)) != 0) {
- if (ret == ENOENT)
- fprintf(stderr, "Anchor '%s' not found.\n",
- anchorname);
- else
+ if (ret != ENOENT)
errc(1, ret, "DIOCGETETHRULESETS");
return (-1);
}
@@ -3477,7 +3479,6 @@ main(int argc, char *argv[])
if ((opts & PF_OPT_NOACTION) == 0) {
pfctl_read_limits(pfh);
- atexit(pfctl_restore_limits);
}
if (opts & PF_OPT_DISABLE)
diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h
index 136f51ea08f9..c540c6348d84 100644
--- a/sbin/pfctl/pfctl.h
+++ b/sbin/pfctl/pfctl.h
@@ -110,7 +110,7 @@ int pfr_clr_astats(struct pfr_table *, struct pfr_addr *, int, int *, int);
int pfr_clr_addrs(struct pfr_table *, int *, int);
int pfr_add_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int);
int pfr_del_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int);
-int pfr_set_addrs(struct pfr_table *, struct pfr_addr *, int, int *,
+int pfr_set_addrs(struct pfr_table *, struct pfr_addr *, int,
int *, int *, int *, int);
int pfr_get_addrs(struct pfr_table *, struct pfr_addr *, int *, int);
int pfr_get_astats(struct pfr_table *, struct pfr_astats *, int *, int);
diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c
index 98f907738d95..823921953eaf 100644
--- a/sbin/pfctl/pfctl_radix.c
+++ b/sbin/pfctl/pfctl_radix.c
@@ -163,11 +163,11 @@ pfr_del_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
int
pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
- int *size2, int *nadd, int *ndel, int *nchange, int flags)
+ int *nadd, int *ndel, int *nchange, int flags)
{
int ret;
- ret = pfctl_table_set_addrs(dev, tbl, addr, size, size2, nadd, ndel,
+ ret = pfctl_table_set_addrs_h(pfh, tbl, addr, size, nadd, ndel,
nchange, flags);
if (ret) {
errno = ret;
@@ -182,7 +182,7 @@ pfr_get_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int *size,
{
int ret;
- ret = pfctl_table_get_addrs(dev, tbl, addr, size, flags);
+ ret = pfctl_table_get_addrs_h(pfh, tbl, addr, size, flags);
if (ret) {
errno = ret;
return (-1);
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c
index 4955e1791fd7..aae347712547 100644
--- a/sbin/pfctl/pfctl_table.c
+++ b/sbin/pfctl/pfctl_table.c
@@ -236,17 +236,8 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command,
CREATE_TABLE;
if (opts & PF_OPT_VERBOSE)
flags |= PFR_FLAG_FEEDBACK;
- for (;;) {
- int sz2 = b.pfrb_msize;
-
- RVTEST(pfr_set_addrs(&table, b.pfrb_caddr, b.pfrb_size,
- &sz2, &nadd, &ndel, &nchange, flags));
- if (sz2 <= b.pfrb_msize) {
- b.pfrb_size = sz2;
- break;
- } else
- pfr_buf_grow(&b, sz2);
- }
+ RVTEST(pfr_set_addrs(&table, b.pfrb_caddr, b.pfrb_size,
+ &nadd, &ndel, &nchange, flags));
if (nadd)
xprintf(opts, "%d addresses added", nadd);
if (ndel)
diff --git a/sbin/ping/tests/Makefile b/sbin/ping/tests/Makefile
index 0520b1d634cf..7d3ab02b9a86 100644
--- a/sbin/ping/tests/Makefile
+++ b/sbin/ping/tests/Makefile
@@ -1,5 +1,6 @@
ATF_TESTS_C+= in_cksum_test
-SRCS.in_cksum_test= in_cksum_test.c ../utils.c
+.PATH: ${.CURDIR:H}
+SRCS.in_cksum_test= in_cksum_test.c utils.c
PACKAGE= tests