Commit graph

10612 commits

Author SHA1 Message Date
Ed Maste
2487dc223a ipfw: Remove more unused IP_FW_* cases
All of the do_cmd() calls are in dummynet.c and specify the socket
option at compile time; none of these removed cases are used in ipfw
after the v3 work.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53378

(cherry picked from commit 0e2e0fb955adf15a217949bc4cc337d53d2c7259)
(cherry picked from commit 6b1e5d4d20a94b5bebd726eb6d1df8dca2738f8e)
2025-11-20 12:32:40 -05:00
Ed Maste
39feb3a0e7 ipfw: Remove IP_DUMMYNET_GET case
IP_DUMMYNET_GET is no longer used in ipfw(1).

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53348

(cherry picked from commit 28e52dea96809c7904e498759ee1f79bda929a82)
(cherry picked from commit 73c105268cc6138015241b080bc7945c6cde0fa6)
2025-11-20 12:32:30 -05:00
Ed Maste
41d43ad19d ipfw: Correct error message
The failed allocation in the error pertains to IP_FW_XADD, not
IP_FW_ADD.

Reviewed by:	ae
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53359

(cherry picked from commit 498e56142660c8dd864c878e820252358c9a15cf)
(cherry picked from commit c22437c8b574878241a3c897a095ae6939e66743)
2025-11-20 12:32:02 -05:00
Ed Maste
f7c13f3363 ipfw: Update warning/error setsockopt references
Dummynet v3 switched to IP_DUMMYNET3 but did not update these
warnings/errors.

Fixes: cc4d3c30ea ("Bring in the most recent version of ipfw and dummynet, developed")
Sponsored by:	The FreeBSD Foundation
Differential Revision: sbin/ipfw/ipfw2.c

(cherry picked from commit 1f95a517880bae5fc0a9fe4463a8f2ec36ed734a)
(cherry picked from commit a5dd21c7dd1f3c8103c2fc6a1caa5635d70671aa)
2025-11-20 12:31:48 -05:00
Zhenlei Huang
839d02c9e3 ifconfig: Display the IFCAP_HWSTATS capability without netlink
This follows the commit 4cdc1f5421, which introduces the IFCAP_HWSTATS
capability.

Fixes:	4cdc1f5421 There are some high performance NICs that count statistics in hardware
MFC after:	3 days

(cherry picked from commit 595acb29a35f36a4fc08b89d3a476f16c1d108b4)
(cherry picked from commit 6bcce275a5a9e10f8e5b990f8cfa2166aa49875a)
2025-10-23 08:18:21 +02:00
Zhenlei Huang
9a29980d3e ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink
Historically this capability is IFCAP_NOMAP but it was renamed to
IFCAP_MEXTPG. Catch up with the change 3f43ada98c.

PR:		289545
Fixes:		3f43ada98c Catch up with 6edfd179c8: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG
MFC after:	3 days

(cherry picked from commit 5017fdb728811fd3e15d7151524378f49a49aee1)
(cherry picked from commit 5f472754ba6f9cc95607956c6e2ad6483c9dd157)
2025-10-23 08:18:21 +02:00
Kristof Provost
c116bd7562 ifconfig: also fix removing IPv6 addresses without netlink
Reported by:	bdrewery
MFC after:	1 week
See also:	da50f49977cc4e6aae55cb2379313599249a8dd2
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c8fb5a4d032b28dd97b9fa4a73f85a84d8d35fdd)
2025-10-23 08:18:21 +02:00
Gordon Tetlow
171adf2f75 Move print_bits to ifconfig.c and make available to other src files.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441

(cherry picked from commit c3e9423743d91ae5b5865602a905900a1855055e)
2025-10-23 08:17:30 +02:00
Dag-Erling Smørgrav
e19c4387d0 ifconfig: Enter jail as soon as possible
Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:		289134
MFC after:	1 week
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D52501

(cherry picked from commit 18fd1443d205aed6be22966125a4820f77571948)
2025-10-23 08:17:08 +02:00
Gordon Tetlow
f54f3b0eb0 Migrate from printb to print_bits for locally defined bit fields.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441

(cherry picked from commit a68e4f7a065218f0bcc5b34ff8d2e73a240b59b2)
2025-10-23 08:16:04 +02:00
Michael Tuexen
878daff4e5 dhclient: improve UDP checksum handling
When sending UDP packets:
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* don't send packet with a checksum of zero, use 0xffff instead as
  required.
When receiving UDP packets:
* don't do any computations when the checksum is zero.
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* when computing the checksum, store the pseudo header checksum
* if the checksum is computed as zero, use 0xffff instead.
* also accept packets, when the checksum in the packet is the pseudo
  header checksum.
The last point fixes a problem when the DHCP client runs in a VM,
the DHCP server runs on the host serving the VM and the network
interface supports transmit checksum offloading. Since dhclient
doesn't use UDP sockets but bpf devices to read the packets, the
checksum will be incorrect and only contain the checksum of the
pseudo header.

PR:			263229
Reviewed by:		markj, Timo Völker
Tested by:		danilo
Differential Revision:	https://reviews.freebsd.org/D52394

(cherry picked from commit 187ee62c71f2be62870f26ae98de865e330121be)
2025-10-23 08:11:21 +02:00
Dag-Erling Smørgrav
fad9cb779f ipfw: Add tests for the NPTv6 rule parser
(cherry picked from commit d879f1c8961d99bdbe6727004bfc6c23924526f8)
2025-10-07 12:08:43 +02:00
Seyed Pouria Mousavizadeh Tehrani
fe13bb6f5f ipfw: Fix segfault in NPTv6 rule parser
If the user specified a prefix length with either the internal or
external prefix, we'd jump to check_prefix where we'd dereference p
which was most likely uninitialized.

Instead, store the various prefix lengths separately and check them
all after the loop.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D50597

(cherry picked from commit 64bc9ac8cd9a42259aeb1715d4e14902aa83fcac)
2025-10-07 12:08:43 +02:00
Lexi Winter
2e20b10703 ifconfig: Support VLAN ID in static/deladdr
Add an optional "vlan <n>" argument to the bridge static and deladdr
commands to allow addresses to be added to / removed from a particular
vlan.  No changes to if_bridge are required as the kernel API already
supports this, it just wasn't exposed in ifconfig.

Add tests for the new functionality, and improve the test for the
existing "static" command.

Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D51243

(cherry picked from commit 3650722abf2922893540361a1369b54abc5ff8d2)
2025-08-26 10:27:25 +02:00
Lexi Winter
9b6cdc5678 ifconfig/ifbridge.c: add get_vlan_id()
This is like get_val() but takes an ether_vlanid_t* and ensures the
value is a valid VLAN ID. This avoids redundant comparisons and
casting when parsing VLAN IDs.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51548

(cherry picked from commit 287a5fdcd3c941ce73705c664b5df4932ba3bad4)
2025-08-26 10:26:29 +02:00
Lexi Winter
6ea749503a ifconfig: Support variable-argument commands
Add a new type of command, DEF_CMD_VARG, which takes an (argc, argv)
pair instead of a fixed number of arguments.  This allows commands
to do their own argument parsing and accept a variable number of
arguments.

Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D51243

(cherry picked from commit 7d4a177efc653bc60a496ba0adf5cb4e0560fa07)
2025-08-26 10:26:10 +02:00
Zhenlei Huang
c7adca0552 ifconfig: Garbage collect unused parameter swabips
and the macro EN_SWABIPS.

The macro EN_SWABIPS is identical to IFF_LINK0 (also historically
IFF_LLC0) and we already have the parameter link0 to toggle IFF_LINK0.

These were inherited from 386BSD 0.1 and have never been used since
the very first FreeBSD release.

Reviewed by:	adrian, #network
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51368

(cherry picked from commit 8632e4e73a6934f3f9996a18932e36b04e6a3faf)
2025-08-18 10:03:28 +02:00
Oleg Streejak
d32b38fd4a route: fix route -n monitor when its output is redirected
This is a small oversight in the transition to netlink; the non-netlink
implementation would explicitly flush its stdout as necessary to avoid
apparent long stalls in output when we end up fully-buffered.  Adjust
the netlink implementation to do the same.  This was noticed while
trying to triage failures in the wg-quick script.

Commit message by kevans, patch by author.

PR:		278265
Fixes:		091fec1188 ("route: switch transport protocol [...]")
Approved by:	so
Security:	FreeBSD-EN-25:14.route

(cherry picked from commit 97b61b22edba74c62adba1d022fb73541aa5ff93)
(cherry picked from commit dd695839efd80fe81143cd6c7a552c30df8448f6)
2025-08-08 11:49:20 +02:00
Koichiro Iwao
8900d0b6e4 ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver
It is removed long ago [1] and unavailable on FreeBSD 11 and later,
but the corresponding entries in the man page were not removed
accordingly.

[1] https://cgit.freebsd.org/src/commit/?id=b1c250ff3ff6af36e95f5cf910973133c3445704

MFH after:	3 days
Reviewed by:	mhorne
Approved by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D51261

(cherry picked from commit cca6a72d7f7131685a082c123aff17208aa1693f)
2025-07-16 12:39:54 +02:00
Alexander V. Chernikov
0e089eb784 ifconfig_netlink.c: MFC: optimise non-listing case
This change produced by melifaro and the commit is concerted with him
as he is pretty busy IRL these days.

The change restores performance of /sbin/ifconfig utility
for non-listing case after it switched from rtsock to netlink(4) API
in FreeBSD 14+.

PR:		287872

(cherry picked from commit b1b17432aa1be670564161232d110461a5dde4ce)
2025-07-15 07:05:14 +02:00
Bjoern A. Zeeb
5f0c664ab0 ifconfig: 802.11: decode more information elements (IEs)
Start dealing with Element ID Extension present (IE T=255) and start
parsing elemants from the Element ID Extension set.

Namely (partially) decode HE_CAPA, HE_OPER, MU_EDCA_PARAM_SET,
and as well as SUP_OP_CLASS.

For length reasons also rename UNKNOWN_ELEMID_%d to ELEMID_%d.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50678

(cherry picked from commit a2a15732eb1db4616aa628ae8bfd4047c40dbaee)
2025-07-09 10:05:46 +02:00
Bjoern A. Zeeb
c596c24693 ifconfig: 802.11: decode RSNXE IE
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D50675

(cherry picked from commit 1313f1c2a35f7dbaba1b2948d2f0c4a1f4113f67)
2025-07-09 10:05:46 +02:00
Lexi Winter
c8759dc5fb link_addr: be more strict about address formats
instead of accepting any character as a delimiter, only accept ':', '.'
and '-', and only permit a single delimiter in an address.

this prevents accepting bizarre addresses like:

	ifconfig epair2a link 10.1.2.200/28

... which is particularly problematic on an INET6-only system, in which
case ifconfig defaults to the 'link' family, meaning that:

	ifconfig epair2a 10.1.2.200/28

... changes the Ethernet address of the interface.

bump __FreeBSD_version so link_addr() consumers can detect the change.

Reviewed by:	kp, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D49936

(cherry picked from commit a1215090416b8afb346fb2ff5b38f25ba0134a3a)

Note-from-OPNsense: not bumping the FreeBSD version for stable/25.7
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
4612cb03a8 ifconfig: 802.11: factor out keyix printing
The node unicast key (PTK) uses a key index of (-1) and printing
a 64k number does not look great.  Factor out printing the key
number into a buffer and use 'ucast' for the node unicast key.
Hope is that this will be useful for the future as well when we
will have more/different keys possibly.

Looks like (with -vk):
        AES-CCM 2:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
        AES-CCM 3:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
        AES-GCM ucast:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 tx+rx

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50555

(cherry picked from commit 164bf9ffbe1a9fc8768b2f597fd4b32b3e406ac1)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
b07fd7a6a6 ifconfig: 802.11: print node unicast key (PTK) if available in STA mode
Add a variable when querying the BSSID so we can later use it rather
than losing the "data" buffer.

When printing key information also query the node unicast key if in
STA mode (the key for the BSSID).  Do not error in case we fail.
This is helpful for debugging mostly; was also useful when testing
GCMP support.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50554

(cherry picked from commit e277735ce05911aaee336cd61ec3a12435f46d8d)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
e965e2f657 ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information
While we currently do not print the STA unicast key (PTK) we will not
see this but it is for fullness and in preparations for follow-up
hanges.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50553

(cherry picked from commit 54ad06cad10c3822784389b0956f92a1c7041abd)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
ed8a87939c ifconfig: 802.11: fix a warning message
s/can/cannot/

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D50552

(cherry picked from commit 08471a76e3d27ffa9e2605dab0ff3c4968e7fef6)
2025-07-09 10:05:44 +02:00
Lexi Winter
0149768ecb ifconfig: reject netmask and broadcast for inet6
We don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig.  Handle this the
same way as af_link, by rejecting attempts to configure these
parameters.

PR:	286910
Reported by:	Hayzam Sherif <hayzam@alchemilla.io>
MFC after:	3 days
Reviewed by:	zlei, kevans, des, cy
Approved by:	kevans (mentor)
Differential Revision:	https://reviews.freebsd.org/D50413

(cherry picked from commit 59ee9260e6bbcc3b5654126eed6e9490315c81f1)

ifconfig tests: remove incorrect #!

Fixes: 59ee9260e6bb ("ifconfig: reject netmask and broadcast for inet6")

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D50566

(cherry picked from commit 6ab70fbec4236a940275a42e301f76ade7faacbf)
2025-07-09 10:05:43 +02:00
Alexander Ziaee
b90ff46567
mount.8: Add a single example for single user mode
The zfs command to do this is a bit longer and harder to remember. In
the last few releases mount(8) learned how to do this, so lets show it
in the manual.

MFC after:		3 days
Reported by:		Jan Bramkamp <crest+freebsd@rlwinm.de>
Discussed with:		cperciva, emaste
Reviewed by:		mhorne
Approved by:		mhorne (mentor)
Differential Revision:	https://reviews.freebsd.org/D49988

(cherry picked from commit c3e06b23b4174c726d7d0ba131869e4aeee8067d)
2025-04-28 02:01:12 -04:00
Colin Percival
d41725ab43 dhclient: Keep two clocks
Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t.  This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't always do the right thing if the system clock
changed.

Switching to using CLOCK_MONOTONIC and struct timespec fixed those
issues but introduced a new problem: CLOCK_MONOTONIC values were being
intepreted as seconds-since-epoch and written to the dhclient.leases
file, causing confusion with DHCP leases expiring in early 1970.

Attempt to compromise between these by keeping track of both times;
any type within dhclient which is a time_t now refers to seconds past
the epoch, while any struct timespec value is a CLOCK_MONOTONIC time.

PR:	283256
Reviewed by:	dch
Fixes:	f0a38976b01e ("dhclient: Use clock_gettime() instead of time()")
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D49720

(cherry picked from commit 43d19e6a4c42ade0f276ceca18a09e2e3829fce4)
2025-04-22 21:50:31 -07:00
Kristof Provost
461b79d8ee pfctl: also remove incorrect counter print for rule anchors
Just as for nat anchors we can't print counters for rule anchors. Remove the
incorrect print call.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 0fc3c29fb3dd6ab6436a78c502544ebf2cf63ee2)
2025-04-21 22:25:46 +02:00
Kristof Provost
a60eeb4331 pfctl: fix crash on "pfctl -a '*' -vvsr"
When printing a nat anchor we don't have rule information, or rule
counters. Do not attempt to print them. The information is nonsensical
anyway, and this can cause a crash converting the timestamp to a string,
as years in the very distant future use more digits, and we exceed the
30 byte buffer allocated for this.

MFC after:	2 weeks
Sponsored by:	Orange Business Services

(cherry picked from commit 168d873ae41fd8bd40555322a79c9f215cb4cb9c)
2025-04-21 22:25:46 +02:00
Alexander Ziaee
a516440afd
msdosfs manuals: Improve visibility and linking
+ add `(FAT)` to all descriptions to enable `apropos fat`
+ xref all msdosfs(4) utilities in base to msdosfs(4)
+ xref msdosfs(4) to all msdosfs(4) utilities
+ remove unrelated fsck_ffs(8) from fsck_msdos(8)

MFC after:	3 days
Reviewed by:	mhorne
Approved by:	mhorne (mentor)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1557

(cherry picked from commit 93f4377caba08e4a47fb9f1878bf609bd4181564)
2025-04-19 20:44:27 -04:00
Kristof Provost
0da1817868 pfctl: fix recursive printing of NAT rules
pfctl_show_nat() is called recursively to print nat anchors. This passes the
anchor path, but this path was modified by pfctl_show_nat(), leading to issues
printing the anchors.

Make a copy of the path ('npath') before we modify it. Ensure we do this
correctly by sprinking in 'const', and add a test case to verify that we do now
print things correctly.

Reported by:	Thomas Pasqualini <thomas.pasqualini@orange.com>
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 58164dcb55d62ca73b5e550b8344bf61e2d8a47a)
2025-04-16 09:34:56 +02:00
Baptiste Daroussin
9157372d3e devd: raise the maximum allowed client to 50
since the creation of libudev-devd, but also with powerd, recent libusb
changes etc. 10 client is not enough anymore to cover the desktop needs

and end users often ends up with:
sonewconn: pcb 0xfffff8004dd43780 (local:/var/run/devd.seqpacket.pipe)...

raise the maximum allowed client to 50, which should be enough to cover
user requirements.

MFC After:	1 week

(cherry picked from commit 5682eee1efd35fb65751641181ae2a50d86efaab)
2025-04-01 14:31:59 +02:00
Tijl Coosemans
487d79d44f devd: Don't install autofs.conf with WITHOUT_AUTOFS
(cherry picked from commit 272b4b764bdfb563f655da37ef9ec8c01c77f386)
2025-03-23 16:32:33 +01:00
Cy Schubert
8f7be9c63c ipf: Correct ippool.5 man page
The file URL must be enclosed in quotes.

(cherry picked from commit 278a726eec5a49284df1f54a586be0fe0ce2e0cf)
2025-03-06 16:33:01 -08:00
Bjoern A. Zeeb
7563a2b96f net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80
ieee80211_setupcurchan() compares the flags in a greater than manner.
In this case VHT160 should be > VHT80P80 as it is preferable.
Swap the two flags and add a comment to note this.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48976

(cherry picked from commit 8f2e5b6ef32304ce340b91057b1eb4b191dbeac1)
2025-02-24 20:26:47 +00:00
Andrey V. Elsukov
fd258b6dd1 ipfw: make 'ipfw show' output compatible with 'ipfw add' command
If rule was added in compact form and rule body is empty, print
'proto ip' opcode to be compatible with ipfw(8) syntax parser.

  Before:
  $ ipfw add allow proto ip
  000700 allow
  After:
  $ ipfw add allow proto ip
  000700 allow proto ip

(cherry picked from commit 706a03f61bbb6e0cf10e6c3727966495b30d763e)
2025-02-21 14:16:15 +03:00
Mark Johnston
bf5056741d savecore tests: Update to match output from savecore(8)
(cherry picked from commit ff13773802dcc22f3585fb953c9fffbb605ce3ac)
2025-02-21 01:04:50 +00:00
Li-Wen Hsu
ef3ed0726f Canonicalize the name of the FreeBSD Foundation
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dab59af3bcc7cb7ba01569d3044894b3e860ad56)
2025-02-19 09:58:47 -05:00
Kristof Provost
8921c82b76 carp: don't unintentionally revert to multicast mode
PR:		284140
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit af33f86e6aef6b15c8aa3da615167272aa7a3ee3)
2025-02-11 17:52:42 +01:00
Bjoern A. Zeeb
4f9bec61d8 ifconfig: make -vht work
Also hide the other vht options on -vht and only show vht40/80/160/80p80
when vht is enabled.

While here fix some whitespace and comments.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48326

(cherry picked from commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
054c043b0a ifconfig: 802.11: fix indentation of a line
No functional changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit cf71349a23f02b55bd3bb4973decac87f7a7d2b8)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
1b5e1d919f ifconfig: remove debug printfs from set80211vhtconf()
Anyone testing VHT options would wonder about these extra two printfs
by now.  Remove them from the tree before I have to do so locally again
in another branch.

Sponsored by:	The FreeBSD Foundation
Fixes:		e9bb7f9aa1
Reviewed by:	adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48319

(cherry picked from commit 91a4107d6d3028acd96df96de33b8a7665d3eb03)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
36ace2a923 net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage
if STBC will be allowed for VHT RX/TX.
For RX this will only allow us to turn it off but no fine grained
control of the number of supported spatial streams.

Introduce IEEE80211_FVHT_CHANWIDTH_MASK as a helper to make the
spelling out of the IEEE80211_FVHT_MASK more readable.

Update ifconfig to allow setting of these flags.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47838

(cherry picked from commit 243f6925bf818a64f3c996c6a89fec6c8a6ff058)
2025-02-10 14:52:08 +00:00
Stéphane Rochoy
546b910adb savecore: add a test for LOG_PERROR
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>

Reviewed by:	markj, oshogbo
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1546

(cherry picked from commit 3dc18af5770f9fc820343021d63dfc4cf09d9906)
2025-02-07 14:46:53 +00:00
Stéphane Rochoy
dff74bbdd0 savecore: add missing call to cap_openlog when in capabilities mode
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>

Reviewed by:	markj, oshogbo
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1546

(cherry picked from commit c901e89d8e467b56f844ab5dba18dc20d503c2be)
2025-02-07 14:46:53 +00:00
Kirk McKusick
5572827428 Defer the January 19, 2038 date limit in UFS1 filesystems to February 7, 2106
Standardize the definition of a UFS dinode

Differential Revision: https://reviews.freebsd.org/D48472

(cherry picked from commit 1111a44301da39d7b7459c784230e1405e8980f8)
(cherry picked from commit aa90fbed151de512ab6e59f75df009533a15751f)
(cherry picked from commit 256389eaf158acaf67f0530764be8af68edee78c)
(cherry picked from commit 6cd973d903c8f214d84daf91eb75047631bf1618)
(cherry picked from commit e1ebda4458bbaf7d85fb803e20f3afc5441f24d9)
2025-02-06 11:25:09 -08:00
Zhenlei Huang
8d5d7e2ba3 sysctl: Teach sysctl to attach and run itself in a jail
This allows the parent jail to retrieve or set kernel state when child
does not have sysctl(8) installed (e.g. light weighted OCI containers
or slim jails).

This is especially useful when manipulating jail prison or vnet sysctls.
For example, `sysctl -j foo -Ja` or `sysctl -j foo net.fibs=2`.

Reviewed by:	dfr (previous version), markj
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D48618

(cherry picked from commit 08aa7128dea4d14811ae4a0225d7c678869cfe62)
2025-02-06 23:38:04 +08:00