11469 Commits
Author SHA1 Message Date
Kenneth D. Merry 68ba58a064 camcontrol: Fix -Wcast-align errors in the NVMe reservation report
Casting the byte buffer that holds the Reservation Report payload to
the status structures trips -Wcast-align on strict-alignment
architectures, which broke the CI builds there.  Put the buffer in a
union with the two status structures instead, so it is properly
aligned and no casts are needed.

Reported by:	FreeBSD CI
Fixes:	ba75cf0572 ("camcontrol: Support NVMe reservations via the persist subcommand")
Co-authored-by:	Claude Fable 5 <[email protected]>
MFC after:	1 week
Sponsored by:	Spectra Logic
2026-11-06 22:33:25 -05:00
Kenneth D. Merry 6eae951cd5 camcontrol: Add a feature subcommand for NVMe Get/Set Features
Add a feature subcommand for the NVMe Get Features and Set Features
commands:

  camcontrol feature ndaX -a <get|set> -f feature [-d data]
      [-s num] [-U]

There is no transport-specific prefix in the name: SCSI has no
feature command (the closest equivalents are mode pages), and the
ATA SET FEATURES subcommands are already exposed through dedicated
camcontrol subcommands (apm, aam, epc and the power commands), so
the name is unclaimed.  The subcommand returns an error for
non-NVMe devices.

Currently, only the hostid feature is fully implemented.  The
hostid value for set is specified with -d as a UUID or an integer
in decimal, hex, or octal, and -U outputs the hostid as a UUID on
get.

The -s argument exposes the feature select / save fields from the
NVMe specification.  If bit 4 of the Optional NVM Command Support
(ONCS) field of the Identify Controller data is set, each feature
has a default, saved and current value, plus a capabilities mask:

  - For get, -s selects which to display: 0 (current),
    1 (default), 2 (saved) or 3 (capabilities).
  - For set, -s is the save flag; a value of 1 sets the saved
    value as well as the current value, so the feature
    persists across an NVMe reset.  Setting the save flag only
    works if the feature's capability mask includes saveable.

sbin/camcontrol/nvfeature.c:
  New file, the camcontrol(8) feature subcommand for getting
  and setting NVMe features.

sbin/camcontrol/camcontrol.c:
  Add the feature subcommand, dispatched only to NVMe devices.

sbin/camcontrol/camcontrol.h:
  Add the nvmefeature() prototype.

sbin/camcontrol/Makefile:
  Add nvfeature.c to the build.

sbin/camcontrol/camcontrol.8:
  Document the feature subcommand.

Co-authored-by:	Reid Linnemann <[email protected]>
Co-authored-by:	Dave Baukus <[email protected]>
Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59536
2026-11-06 20:05:56 -05:00
Kenneth D. Merry 80f090111a camcontrol: Support NVMe namespace formatting via the format subcommand
Support formatting NVMe namespaces through the existing format
subcommand.  The format subcommand now dispatches on the device
protocol, in the same way the identify and persist subcommands do,
and issues the NVMe FORMAT NVM command for NVMe devices.

The SCSI syntax and behavior are unchanged.  The NVMe-specific
options are -e (secure erase setting), -G (format all namespaces),
-f (LBA format), -l (protection information location), -m (metadata
setting) and -p (protection information type).  The -q and -y options
work for both protocols; NVMe formats gain the same confirmation
question that SCSI formats have always had.  The -r and -w options
are SCSI only; -r returns an error for NVMe devices and -w has no
effect, since the NVMe format command does not complete until the
format is finished.

The default timeout for NVMe is 30 seconds for a cryptographic erase
and 30 minutes otherwise; the generic -t option overrides it.

sbin/camcontrol/nvformat.c:
  New file, the NVMe format backend for the format subcommand.

sbin/camcontrol/camcontrol.c:
  Dispatch the format subcommand to scsiformat() or
  nvmeformat() based on the device protocol.

sbin/camcontrol/camcontrol.h:
  Add the nvmeformat() prototype.

sbin/camcontrol/Makefile:
  Add nvformat.c to the build.

sbin/camcontrol/camcontrol.8:
  Document NVMe support in the format subcommand section, and
  note the differences from SCSI where they occur.

Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59535
2026-11-06 20:05:56 -05:00
Kenneth D. Merry ba75cf0572 camcontrol: Support NVMe reservations via the persist subcommand
The NVMe reservation model is closely patterned after SCSI Persistent
Reservations, so support NVMe devices through the existing persist
subcommand rather than adding a transport-specific subcommand.  The
persist subcommand now dispatches on the device protocol, in the same
way the identify subcommand does.

The SCSI syntax is unchanged.  For NVMe devices, the -i modes all map
to the Reservation Report command (read_full_status requests the
extended data structure, which contains 128-bit Host Identifiers), and
the -o service actions map to the corresponding NVMe reservation
operations: register, register_ignore, reserve, preempt,
preempt_abort, release and clear, plus two NVMe-only actions,
unregister and replace.  The reservation type names for -T are shared
between SCSI and NVMe.  A new -c option gives explicit control over
the NVMe Persist Through Power Loss State; -p is equivalent to
-c enable.  SCSI-only options return an error for NVMe devices.

Tested against a PASCARI X200 series SSD (reservation capabilities:
WR_EX, PTPL, IEKEY13): register, reserve, release, replace,
unregister, -c enable/disable (Persist Through Power Loss State change
verified in the report output), reservation report, and the error
paths.  register_ignore is rejected by drives that implement NVMe 1.3
IEKEY semantics, as expected.  SCSI persist against a da(4) device is
unchanged.

sbin/camcontrol/nvres.c:
  New file, the NVMe reservation backend for the persist
  subcommand.

sbin/camcontrol/camcontrol.c:
  Dispatch the persist subcommand to scsipersist() or
  nvmepersist() based on the device protocol.

sbin/camcontrol/camcontrol.h:
  Add the nvmepersist() prototype.

sbin/camcontrol/Makefile:
  Add nvres.c to the build.

sbin/camcontrol/camcontrol.8:
  Document NVMe support in the persist subcommand section, and
  note the differences from SCSI where they occur.

Co-authored-by:	Reid Linnemann <[email protected]>
Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59534
2026-11-06 20:05:55 -05:00
Kenneth D. Merry 961fa195b3 camcontrol: Add support for NVMe namespace Identify
Add a -N argument to camcontrol identify.  This will fetch and
display namespace Identify data for NVMe drives, using
nvme_print_namespace() from nvmecontrol(8).

This gets the namespace Identify data via XPT_DEV_ADVINFO (i.e.
data cached in the kernel) like the standard NVMe identify command
does, and so works even on NVMe devices that do not support NVMe
Namespace Management.

sbin/camcontrol/camcontrol.c:
	Add a -N argument to camcontrol identify.

	Rename nvme_get_cdata() to nvme_get_data(), and give it the
	ability to fetch controller or namespace Identify data.
	While here, improve its error reporting with
	cam_error_print(), and only look at the CAM status bits of
	the returned CCB.

	Change identify(), ataidentify(), and nvmeidentify() to
	handle the extra arguments.

	Give nvmeidentify() the ability to fetch and print NVMe
	namespace data, using nvme_print_namespace() from
	nvmecontrol(8).

sbin/camcontrol/camcontrol.h:
	Add the nvme_get_data() prototype, for use by future NVMe
	subcommands living outside camcontrol.c.

sbin/camcontrol/camcontrol.8:
	Document camcontrol identify -N.  Make it clear that the
	NVMe data is from data cached in the kernel.  Add a cross
	reference to nvmecontrol(8).

Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59533
2026-11-06 20:05:55 -05:00
Kenneth D. Merry 7a9e437531 nvme: Add reservation, format and features command building support
Add command (struct nvme_command) building functions for the four
NVMe reservation opcodes (Report, Register, Acquire and Release),
Format NVM, and Get Features / Set Features, along with the
enumerations and data structures that go with them.  These are
shared between the kernel and userland, and are the underpinnings
for new camcontrol(8) subcommands (nvres, nvformat, nvfeature) that
will be added separately.

The reservation type names are intentionally similar to the SCSI
names for the same reservation types.

sys/dev/nvme/nvme.h:
  Add NVMe command building functions for the four NVMe
  reservation opcodes: nvme_ns_resv_report_cmd(),
  nvme_ns_resv_register_cmd(), nvme_ns_resv_acquire_cmd() and
  nvme_ns_resv_release_cmd().

  Add enumerated types for the various NVMe reservation
  subcommand actions (acquire, register, release), reservation
  types, and Change Persist Through Power Loss State values.

  Add struct nvme_resv_acq_data and struct nvme_resv_reg_data,
  the data payloads for reservation Acquire and Register.

  Add a new NVMe Format NVM command building function,
  nvme_admin_format_cmd(), and an enumeration for the Secure
  Erase Setting parameter for format.

  Add nvme_admin_get_feature_cmd() and
  nvme_admin_set_feature_cmd() functions to fill a struct
  nvme_command for Get Features / Set Features.

  Add macros for bitfields in the ctratt and mic dwords of the
  NVMe Identify Controller data structure.

  Add a prototype for nvme_hostid_sbuf().

  Stop byte swapping the hostid fields in
  nvme_resv_status_swapbytes() and
  nvme_resv_status_ext_swapbytes(), and document the fields as
  little endian.  The hostid is an opaque 8 or 16 byte value;
  keep it in the byte order the device returns it in instead of
  interpreting it at this level.

  Widen the nvme_ctrlr_cmd_get_feature() and
  nvme_ctrlr_cmd_set_feature() prototypes as described below.

  While here, fix the entry count clamp in the reservation status
  swapbytes functions to use sizeof(*s) rather than sizeof(s); using
  the pointer size made the clamp one entry too permissive.

sys/dev/nvme/nvme_util.c:
  Add nvme_hostid_sbuf(), which formats an 8 or 16 byte hostid
  (from the Get Features hostid feature, in the little-endian
  byte order the device returns it in) into an sbuf as an
  integer value in base 16, most significant byte first.

sbin/nvmecontrol/resv.c:
  Decode the now little-endian hostid fields explicitly when
  printing, and zero pad the printed 64-bit values.  Previously
  the extended hostid printed in a different byte order on big
  and little endian machines, and without zero padding between
  the two halves.

sys/dev/nvme/nvme_ctrlr_cmd.c:
  Refactor nvme_ctrlr_cmd_get_feature() and
  nvme_ctrlr_cmd_set_feature() to use the new command building
  functions from nvme.h and accept a namespace ID parameter.

  Refactor nvme_ctrlr_cmd_set_feature() to also accept the sv
  (save) parameter to persist a feature value across reset.

sys/dev/nvme/nvme_ctrlr.c:
  Update the temperature threshold, autonomous power state
  transition and host memory buffer callers for the new
  nvme_ctrlr_cmd_get_feature() and nvme_ctrlr_cmd_set_feature()
  arguments.

Co-authored-by:	Reid Linnemann <[email protected]>
Co-authored-by:	Dave Baukus <[email protected]>
Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59531
2026-11-06 20:05:54 -05:00
Kenneth D. Merry 46198fba6d nvmecontrol: Factor out namespace Identify printing
Move print_namespace() from identify.c to identify_ext.c and rename
it to nvme_print_namespace(), to match nvme_print_controller().
This allows other consumers (notably camcontrol(8)) to print NVMe
namespace Identify data.

No functional changes intended.

sbin/nvmecontrol/identify.c:
	Remove print_namespace(), and call nvme_print_namespace()
	instead.

sbin/nvmecontrol/identify_ext.c:
	Add nvme_print_namespace(), moved here from identify.c.

sbin/nvmecontrol/nvmecontrol.h:
	Remove the print_namespace() prototype.

sbin/nvmecontrol/nvmecontrol_ext.h:
	Add the nvme_print_namespace() prototype.

sbin/nvmecontrol/ns.c:
	Include nvmecontrol_ext.h, and rename print_namespace() calls
	to nvme_print_namespace().

Co-authored-by:	Claude Fable 5 <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D59530
2026-11-06 20:05:53 -05:00
Benedict Reuschling b56d312cd5 tunefs.8/newfs.8: Specify unit of the avgfilesize parameter
The avgfilesize description does not say what the unit is (sectors,
blocks, bytes). Extend the description to mention that this parameter is
in bytes.

PR:                     298705
Event:	                Oslo Hackathon 2026
Differential Revision:  https://reviews.freebsd.org/D61047
2026-10-29 20:24:08 +01:00
Dag-Erling Smørgrav 2321b3df1f hastd: Add full lifecycle test
Add a test case that creates and starts two nodes, has one assume the
primary role and the other the secondary role, writes to the device,
verifies that the data is synced to both nodes, then switches the roles,
and finally shuts both nodes down and compares their backing stores.

Differential Revision:	https://reviews.freebsd.org/D59676
2026-11-03 13:07:35 +01:00
Dag-Erling Smørgrav a4c5803ecd hastd: Allow overriding the node name
Normally, hastd will use the hostname, hostuuid, or hostid as node name.
Allow overriding this with a new -n command-line option.  The argument
is treated as a replacement for the hostname, but also disables the
hostuuid and hostid logic.  This allows running multiple nodes on the
same system, which is useful for testing.

Differential Revision:	https://reviews.freebsd.org/D59675
2026-11-03 13:07:29 +01:00
Kristof Provost e4a2b19aa9 pfctl: err(3) family functions should not be used with trailing \n
Obtained from:	OpenBSD, deraadt <[email protected]>, 3c04d8eee2
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-11-02 13:40:02 +01:00
Dag-Erling Smørgrav 3f2f6bb8f7 hastd: Remove pidfile on exit
Make hastd remove its pidfile before exit after catching a signal or a
stop control message, not just on failure to start.

MFC after:	1 week
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D60192
2026-11-02 13:30:42 +01:00
Peter Wemm 8df518457e route: remove reference to long-gone netiso protocol in route(8). 2026-11-01 01:14:28 -07:00
Avinash Duduskar 87a5d76973 pfctl: add -l to use an inherited Netlink socket
pf's Netlink commands are checked against the credentials of the socket,
so a socket opened by a privileged process keeps its authority across a
privilege drop and exec, as the /dev/pf descriptor passed as -p
/dev/fd/N already does. -l takes the descriptor number of such a socket
and uses it for every request instead of creating a new one.

authpf(8) uses this to run pfctl as the logged-in user.

PR:		291981
Signed-off-by:	Avinash Duduskar <[email protected]>
Reviewed by:	kp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2508
2026-10-30 15:07:04 +01:00
Kristof Provost a7aad5bbcd pf: convert DIOCXBEGIN, DIOCXROLLBACK, DIOCXCOMMIT to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-30 13:21:10 +01:00
Mark Johnston 8fa55fdcae tests/dhclient: Skip tests if scapy is not installed
Fixes:	a143197801 ("dhclient: Add some regression tests")
2026-10-28 20:26:44 +00:00
Siva Mahadevan bd87fc2a1c tests/dhclient: import scapy inside vnet
This fixes a [CI failure][0].

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/sbin.dhclient.functional/py/__test_cases_list__/

PR:		299641
Reviewed by:	markj, ngie
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/83
2026-10-28 15:15:44 -04:00
Siva Mahadevan 25024d9649 sbin/nvmecontrol: fix signedness comparison warning
sector_size is guaranteed to be non-zero here, so cast to
uint32_t to match the comparison.

This fixes the [gcc14 build in CI][0]:

/workspace/src/sbin/nvmecontrol/format.c: In function 'find_lbaf':
/workspace/src/sbin/nvmecontrol/format.c:132:60: error: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Werror=sign-compare]
  132 |                 if (NVMEV(NVME_NS_DATA_LBAF_LBADS, format) != lbads ||
      |                                                            ^~

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/5051/

Reviewed by:	imp
Fixes:		b991e2dd82 ("nvmecontrol: support controller-wide sector sizes")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2026-10-28 09:18:47 -04:00
Wolfram Schneider 741197267e manpages: Fix unusual Xr order 2026-10-25 11:51:42 +00:00
Maxim Konovalov b9585475ee jail.8: fix a typo, sort Xr
PR:		299990 (typo part)
MFC after:	1 week
2026-10-24 16:32:58 +00:00
Dag-Erling Smørgrav dff56e8118 hastd: Fix build failure
Fixes:		a5e6bee5a0 ("hastd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:58:45 +02:00
Dag-Erling Smørgrav a5e6bee5a0 hastd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D60729
2026-10-20 15:28:42 +02:00
R. Christian McDonald 96944ab79a pfctl: Report why a table definition failed
pfctl_ina_define() returns an error number instead of setting errno, but
both of its callers print errno.  A table that failed to load was
reported as "cannot define table t: No error: 0", or with a stale errno,
both in the main ruleset (process_tabledef()) and in anchors
(pfctl_load_tables()).

Reviewed by:	kp
Fixes:		219ce30638 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-19 16:24:36 -04:00
R. Christian McDonald 1594fbd7f2 pfctl: Report the error of a failed fingerprint flush
pfctl_flush_fingerprints() returns an error number instead of setting
errno, so a failed flush was reported with whatever errno held: "No
error: 0" on a kernel with ALTQ, ENODEV from the ALTQ probe on one
without.  Every "pfctl -f" flushes the fingerprints first, so on a
kernel that predates PFNL_CMD_OSFP_FLUSH every ruleset load fails this
way without saying why.

Reviewed by:	kp
Fixes:		75c0a83762 ("pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-19 15:14:04 -04:00
Warner Losh ee96770ee3 nvmecontrol: Fix mixup between pi and pil
pi and pil were extracted from the incorrect place. Swap how we get/set
there to be correct. However, since these are always 0, this is a nop.
2026-10-19 00:22:51 -06:00
Warner Losh bf3726998f nvmecontrol: Use admin device for admin-passthru
When we're doing admin-passhtru, we need to use the admin device, not
the namespace device. So when we're passed in ndaX or nvdX, we need to
translate that to nvmeY for this command for the admin-passthru command,
but not the io-passthru command. Note namespace nuance in man page.

Differential Revision:	https://reviews.freebsd.org/D59878
2026-10-19 00:22:51 -06:00
Warner Losh 3b66efc6e9 nvmecontrol: add format dry-run support
Add -n/--dry-run to resolve and print the Format NVM command without
submitting it. This lets users verify namespace selection and format
parameters before making destructive media changes.

Reviewed by:		seuros, chuck
Differential Revision:	https://reviews.freebsd.org/D59835
2026-10-19 00:22:51 -06:00
Warner Losh b991e2dd82 nvmecontrol: support controller-wide sector sizes
Extend sector-size selection to controller-wide formats when every
namespace has one compatible format index and matching effective
metadata and protection settings. Reject ambiguous or inconsistent
layouts so heterogeneous fleets can request a sector size without
risking an unintended controller-wide format.

Reviewed by:		seuros, chuck
Differential Revision:	https://reviews.freebsd.org/D59834
2026-10-19 00:22:51 -06:00
Warner Losh 4623bbfe7b nvmecontrol: select format by sector size
Add automatic selection of lbaf value based on a single sector size. The
lbas (the data sector size) is selected based on the power of 2 in the
sector size, and the metadata size is selected by the remainder. If an
lbaf matches these values is used, otherwise we exit with an error.
When there's a tie, we prefer the higher performance.

Manual selection of these values remains as well for times when we
select incorrectly.

Reviewed by:		seuros, chuck
Differential Revision:	https://reviews.freebsd.org/D59833
2026-10-19 00:22:51 -06:00
Ed Maste d5612784ab Revert "umb: Update man page HISTORY"
Oops, pushed in error from a staging branch.

This reverts commit ed79730624.
2026-10-15 13:59:44 -04:00
Ed Maste ed79730624 umb: Update man page HISTORY
It was merged to stable/14 prior to FreeBSD 14.4.
2026-10-15 13:55:47 -04:00
Mark Johnston a143197801 dhclient: Add some regression tests
Add tests for some recently fixed bugs in dhclient.  All of these tests
set up two VNET jails connected by an epair.  dhclient runs in one jail,
and the test code runs on the other end.  It uses scapy to inject
"interesting" packets in response to DHCPDISCOVER messages from
dhclient, then checks the configured interface and lease file.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60485
2026-10-15 15:18:32 +00:00
Mark Johnston 368a1bfcd4 dhclient: Avoid out-of-bounds reads in check_classless_option()
The loop did not verify that the option buffer is large enough before
reading an address.

Reported by:	Andrew Griffiths <[email protected]>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60484
2026-10-15 14:50:33 +00:00
Alan Somers 802f5e4d69 ggate: fix test intermittency
* ggatel: fix piped output.  Flush stdout before daemonizing, so the
  output can be read when it's in a command pipeline.

* ggated: bind the port _before_ daemonizing, so an invoking script can
  be sure that the port is bound as soon as the command returns.

* tests: allow ggatec or ggatel to automatically allocate a device
  number instead of choosing one in a racy way.

With all of these changes I can no run the tests 1000 times without
fail.  And in parallel, too.

MFC after:	1 week
Sponsored by:	ConnectWise
PR:		298942
Reported by:	siva
Reviewed by:	ngie
Differential Revision: https://reviews.freebsd.org/D60707
2026-10-15 06:16:16 -06:00
R. Christian McDonald 40d42dc214 pfctl: remove the prototype of pfr_ina_define()
The function went when DIOCRINADEFINE was converted to netlink; pfctl
calls pfctl_ina_define() from libpfctl instead.  Name that one in the
error message that pfctl_load_tables() prints when it fails.

Fixes:		219ce30638 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-11 13:38:40 -04:00
Baptiste Daroussin 6c305c3c31 dhclient-script(8): s/URI/URL
Reported by:	glebius@
2026-10-07 22:05:16 +02:00
Baptiste Daroussin 0f1ca95d77 dhclient-script: store the Captive Portal URI
Write the URI received in DHCP option 114 to
/var/run/captive-portal.IFACE atomically, with the legacy option 160 as
a fallback, and remove the file on EXPIRE and FAIL.

Reviewed by:	bcr (manpage)
Differential Revision:	https://reviews.freebsd.org/D60259
2026-10-07 16:07:09 +02:00
Baptiste Daroussin 7ba7285593 dhclient: export the Captive Portal URI to the script
Differential Revision=	https://reviews.freebsd.org/D60259
2026-10-07 16:07:09 +02:00
Baptiste Daroussin afee6fb209 dhclient: request the Captive Portal options
Add DHCP options 114 (captive-portal) and 160 (captive-portal-legacy)
to the default Parameter Request List so that servers advertise the
Captive Portal API URI.

Approved by:		emaste
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D60257
2026-10-07 16:07:09 +02:00
Baptiste Daroussin a1789e345d dhclient: recognize the Captive Portal DHCP options
Rename option 114 from "url" to "captive-portal" (RFC 8910) and retain
"url" as a deprecated alias.  Rename option 160 from the generic
"option-160" to "captive-portal-legacy" (RFC 7710).

Reviewed by:	emaste, dch
Apprived by:	emaste, dch
Differential Revision:	https://reviews.freebsd.org/D60256
2026-10-07 16:07:08 +02:00
Ed Maste e3f5a83b8f camcontrol: Add Spectra Logic copyright
The majority of lines of code currently in fwdownload.c come from ken@'s
rework in commit 0e358df062 ("Revamp camcontrol(8) fwdownload support
and add the opcodes subcommand.").  Add the appropriate copyright.

Approved by:	ken
2026-10-06 16:14:51 -04:00
Peter Eriksson b30e67dc13 camcontrol: Add support for firmware uploading on HPE-branded drives
PR:		299059
2026-10-05 09:11:27 -04:00
R. Christian McDonald 55a69b9be8 libpfctl: zero the counters before summing per-chunk results
The chunked table address functions (set, add, del, clr_astats) add
each chunk's result to the caller's counter without initialising it.
pfctl reuses nadd for the number of tables created, so a replace that
also creates the table is off by one:

pfctl -t foo -T replace 192.0.2.1

reports "2 addresses added".

Zero the counters first, as pfctl_test_addrs() already does. Remove
the workaround for the add case from pfctl (da64f6e047), which is
no longer needed.

Add a regression test.

Reviewed by:		kp
Approved by:		kp (mentor)
Fixes:			08ed87a4a2 ("pf: convert DIOCRSETADDRS to netlink")
MFC after:		1 week
Sponsored by:		Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D60174
2026-09-30 19:23:21 -04:00
R. Christian McDonald 3171a60de4 pfctl: print "pass" on nat/rdr/binat rules again
c2d03a920e rewrote the action printing in print_rule() from OpenBSD,
which has no natpass, and dropped the "pass" keyword.  A ruleset
loaded from "pfctl -sn" output therefore lost its nat-pass semantics.

Add a parser test covering nat, rdr, rdr log and binat with pass.

Reviewed by:		kp
Approved by:		kp (mentor)
Fixes:			c2d03a920e ("pfctl: fix anchortypes bounds test")
MFC after:		1 week
Sponsored by:		Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D60183
2026-09-30 18:02:46 -04:00
Li-Wen Hsu ef27f78469 ifconfig(8): show parent device for USB Ethernet interfaces
Report net.ue.<unit>.%parent as "parent interface", consistent with
wlan(4):

  # ifconfig ue0
  ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
          ether 00:00:5e:00:53:2a
          inet 192.0.2.10/24 broadcast 192.0.2.255
          parent interface: ure0
          media: Ethernet autoselect (2500Base-T <full-duplex>)
          status: active

Reviewed by:	aokblast
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59060
2026-09-28 03:31:12 +08:00
Li-Wen Hsu 1d94247d0e geom: Document existing --libxo support in the manual pages
The standard list and status subcommands of every GEOM class emit
through libxo, and so does geom -p, but only geom.8 (list, status) and
gpart.8 (show) mentioned it.  Mark the list and status forms with
--libxo in all class manual pages, add the option description, and
cross-reference xo_options(7).  Also mark geom -p in geom.8.

Only forms whose output already goes through libxo are marked;
class-specific verbs such as gmirror dump still print directly and are
left alone.

Reviewed by:	adrian, bcr, carlavilla, des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D59574
2026-09-28 01:54:40 +08:00
Abdelkader Boudih 22039031a1 nvme: name the reserved Identify Controller fields at bytes 102 through 110
Bytes 102 through 110 of the I/O Command Set Independent Identify
Controller data structure were reserved padding.  Name them: Boot
Partition Capabilities (byte 102), CXL HDM Support Information (byte
103), NVM Subsystem Shutdown Latency (bytes 107:104) and Power Loss
Signaling Information (byte 110).  Bytes 109:108 stay reserved.

CXL HDM Support Information was added in NVM Express Base Specification
2.4, Figure 338; the others appear in 2.3, Figure 328.

Report the new fields from nvmecontrol identify.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60000
2026-09-26 09:22:46 +01:00
Yunheeee 269002da45 fsck_msdosfs: fix head bitmap over-allocation on 32-bit platforms
bitmap_ctor() computed the allocation size as

	roundup2(bits, LONG_BIT) / (LONG_BIT / 8)

The dividend is a count of bits, so converting it to bytes requires
dividing by 8 (bits per byte), not by LONG_BIT / 8 (bytes per long).
The two divisors happen to coincide on LP64, but on ILP32 platforms
the head bitmap was allocated at twice the required size; for a
FAT32 file system with close to 2^28 clusters, that is 64 MiB instead
of 32 MiB.

The extra half of the allocation was never accessed, so there is no
functional change other than the reduced memory footprint.

MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2440
2026-09-25 20:10:04 -07:00
Kristof Provost 75c0a83762 pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-09-25 17:45:43 +02:00
Kristof Provost 219ce30638 pf: convert DIOCRINADEFINE to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-09-25 17:45:43 +02:00