Commit graph

10466 commits

Author SHA1 Message Date
Franco Fichtner
03c1257577 Revert "Use 115200 bps by default for serial communication"
This reverts commit 4722ceb7d5.
2024-09-09 21:50:14 +02:00
Kristof Provost
0e17479475 pfctl tests: fix dependency
Ensure that we rebuild the test binary when we add tests (i.e. modify
pfctl_test_list.inc).

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 250e074e5f)
2024-09-05 08:12:19 +02:00
Juraj Lutter
f735d20b9b pfctl: Allow a semicolon (;) as a comment
To make parsing of, for example, Spamhaus' drop.txt and similar
files that contains semicolons as comments, allow them also
in file-based tables.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46088

(cherry picked from commit a8a9527736)
2024-08-09 08:28:55 +02:00
Kristof Provost
4808145303 pfctl: fix recursive printing of nat anchors
Similar to the preceding fix for rules, ensure that we
recursively list wildcard anchors for nat rules.

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

(cherry picked from commit 8ddd0359bc)
2024-07-10 08:02:33 +02:00
Michael Gmelin
5734aad037 ifconfig: Fix default netmask calculation
Reported by:	phk
Reviewed by:	emaste, kp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45570

(cherry picked from commit 8a9f0fa42b)
2024-06-17 10:58:55 +02:00
Pau Amma
a2bc504df1 ifconfig(8): wordsmith -G and -g descriptions
Remove spurious ".Ar groupname".
Add missing full stops.
While there, tweak word order for better grammar.

MFC after: 3 days

Reviewed by:	Alexander Ziaee, Mina Galić, allanjude, imp
Differential Revision:	https://reviews.freebsd.org/D45092

(cherry picked from commit 21faf821a3)
2024-06-17 10:58:29 +02:00
Gregory Shapiro
8073345776 ifconfig tunnelfib is implemented in wg(4)
MFC After: 1 week
Reviewed by: imp, zlei, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/1186

(cherry picked from commit f578d01997)
2024-06-03 11:06:56 +02:00
Zhenlei Huang
11e2846440 ifconfig: Redo fix vlan/vlanproto reconfiguration
When the if_vlan(4) interface has not been fully configured, i.e., a
bare interface without a physical interface associated with it,
retrieving the current settings of it and unconditionally overwriting
`params` will result in losing vlandev settings in `params`. That will
lead to failing to associate the if_vlan(4) interface with the requested
physical interface and the false report 'both vlan and vlandev must be
specified'.

Fix that by checking if the vlan interface has been fully configured.

The basic VLAN test is slightly modified to cover this case.

PR:		279181
Reviewed by:	kp
Tested by:	Mike Tancsa <mike@sentex.net>
Fixes:		b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45283

(cherry picked from commit 76df3c57a0)
2024-06-03 11:06:56 +02:00
Franco Fichtner
6a08b65951 dhclient: remove unused primary_address
Its last use was removed in 396c752136.

Reviewed by:		imp
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1257
Differential Revsiion:	https://reviews.freebsd.org/D42717
2024-06-03 11:06:56 +02:00
Dag-Erling Smørgrav
f44abb7055 ifconfig: Add format shortcuts.
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45166

(cherry picked from commit 847ef59d4b)

ifconfig: Markup nits.

MFC after:	3 days
Reviewed by:	imp, allanjude
Differential Revision:	https://reviews.freebsd.org/D45209

(cherry picked from commit 42b28f8152)
(cherry picked from commit dd1a16c9e2)

Approved by:	re (cperciva)
2024-05-20 22:37:28 +02:00
Kirk McKusick
6b2af2d88f Enable soft updates by default for UFS2 filesystems.
Differential Revision: https://reviews.freebsd.org/D45201

(cherry picked from commit 61dece6d27)
(cherry picked from commit 7465f9fc06)

Approved by: re (Colin Percival)
2024-05-16 16:43:01 -07:00
inkeliz
a2eaf1cdd6 dumpon: fix set but not used variable
Signed-off-by: inkeliz <inkeliz@inkeliz.com>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1178

(cherry picked from commit 464b1ab216)
2024-04-25 09:20:18 -04:00
Gordon Bergling
6e97dd94f3 ifconfig(8): Fix two typos in source code comments
- s/the the/the/

(cherry picked from commit 68b9eb9185)
2024-04-23 07:23:37 +02:00
Christopher Davidson
7f1fc5dbc6 mount_mfs.8: remove self-reference
Change .Xr instances to .Nm, which quiets several mandoc warnings.

Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1135

(cherry picked from commit 2ebc7806a1)
2024-04-18 15:18:34 -03:00
Ed Maste
ea3b15d005 bsdlabel: emit deprecation notice when run
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Reision: https://reviews.freebsd.org/D43586

(cherry picked from commit 3661658c76)
2024-04-18 10:05:01 -04:00
Gleb Smirnoff
cc16c3c3cb pfilctl: fix 'pfilctl hooks' when nothing is connected
The 'hooks' command actually worked accidentially until now.  It used
PFILIOC_LISTHEADS to determine current number of hooks.  This worked when
at least one head had a hook connected to it.

(cherry picked from commit 1bfe195143)
2024-04-16 08:56:13 -07:00
Ed Maste
bf4972a48d bsdlabel: add deprecation notice
gpart is the preferred tool for managing partitions of all types,
including BSD disklabels.

Note that this is only about bsdlabel/disklabel, the tool -- there is no
current plan to remove support for MBR or BSD disk labels from the
kernel or from gpart.

Reviewed by:	imp, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43563

(cherry picked from commit b6f3cced15)
2024-04-16 09:57:43 -04:00
Ed Maste
7ced571062 ccdconfig: reference gpart rather than fdisk and disklabel
fdisk and disklabel are legacy tools for legacy disk partitioning
schemes.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43564

(cherry picked from commit 8669e516f0)
2024-04-09 09:35:28 -04:00
John Baldwin
05a831511b nvmecontrol: Update the test for a valid firmare revision slot
Reported by:	Coverity Scan
CID:		1539214
Fixes:		7485926e09 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings

(cherry picked from commit 1b38f851d8)
2024-04-08 11:01:30 -07:00
John Baldwin
1608990524 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings
In particular, don't try to byteswap the values as 64-bit integers and
always print a non-empty version as a string.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44121

(cherry picked from commit 7485926e09)
2024-04-08 11:01:02 -07:00
Alexander Ziaee
d32c600949 newfs_msdos.8: example for specific cluster size
The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards
for older hardware. In most tutorials, they call the cluster size "allocation
size". Therefore, add a small note next to cluster size that it is also called
allocation size, and add an example for how to do this.

Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1045

(cherry picked from commit c8bf9f09ee)
2024-04-08 10:37:58 -07:00
Ricardo Branco
1449754218 cd9660: Add support for mask,dirmask,uid,gid options
Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/982

(cherry picked from commit 82f2275b73)
2024-04-08 10:25:46 -07:00
Ed Maste
9f9289901c bsdlabel: add BUGS section documenting 8 partition limit
PR:		276517
(cherry picked from commit 7dc5c6c412)
2024-04-02 09:56:28 -04:00
Stefan Eßer
10f08c01de ldconfig: remove ignored -v (verbose) option
The -v option used to print useful information when operating on a.out
format libraries. After the removal of a.out support, it was accepted
but did not have any effect.

Remove the option and update the man-page.

While here mention the set of historic options that are accepted but
ignored: "-elf", "-s", and "-v".

The FILES section contained outdated information and did not mention
the way library directories of optional ports and packages are
included in the library search path recorded in the hints file.

The description of the "-B" option was incorrect (described a planned
change) for big-endian platforms (powerpc64). These do still default
to big-endian hints files, since the current version of the "pkg"
program expects the hints file to be in native byte-order.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44139

(cherry picked from commit 484de86fbe)
2024-03-29 07:49:25 +01:00
Stefan Eßer
fa7b31166d ldconfig: support hints files of either byte-order
Make the ldconfig program accept hints files in little-endian and
big-endian format on all architectures.

The default format is the native byte-order of the respective host.
This is expected to change when a version of the pkg command is
available that implements support for either byte-order in its
internal ldconfig function. (Already committed in the development
tree of the pkg utility, a release is expected at the end of Q1/2024).

This update adds the -B option to the ldconfig program. It enforces
the creation of a big-endian hints file on a little-endian host.
The main purpose to is support of tests with non-native byte-order
files on little-endian hosts. It will be removed when all supported
FreeBSD releases use little-endian hints files by default.

When little-endian hints files are generally used, support of
either byte-order in libexec/rtld can also be removed.

When support for big-endian hints files is no longer required,
the COND_SWAP macro in ldconfig and rtld shall be replaced by
le32toh(), which just return their argument on little-endian
architectures.

Approved by:	kib
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D44093

(cherry picked from commit e0dfecadf5)
2024-03-29 07:49:02 +01:00
Ed Maste
a323dd42bc bsdlabel: limit to 8 partitions
bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR:		276517
(cherry picked from commit 3f4f82c0d7)
2024-03-22 14:42:59 -04:00
Ed Maste
b5ae8f2171 ccdconfig: remove obsolete references to BSD disklabels
ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their
use on the underlying disks, but this hasn't been the case since 2003
(commit 0f76d6d822).

Remove disklabel references from the man page.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43574

(cherry picked from commit a3ed434a69)
2024-03-22 09:30:31 -04:00
Ed Maste
1bc20e8af1 mount: document atime option
atime is enabled by default, but may be specified explicitly so that any
future change in the default would not have an effect on a given mount.

Reviewed by:	olce, rgrimes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43580

(cherry picked from commit 54d31cfb27)
2024-03-22 09:30:30 -04:00
Dag-Erling Smørgrav
d5d2452bf5 bectl: Simplify command aliases.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44406

(cherry picked from commit a46217ce7d)
2024-03-22 09:07:03 +01:00
Dag-Erling Smørgrav
98a9731683 bectl: Use geopt() and drop mention of -?.
MFC after:	3 days
PR:		272260
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44405

(cherry picked from commit e819534f15)
2024-03-22 09:07:03 +01:00
Dag-Erling Smørgrav
c3f4736f04 ping: Fix protocol selection with NOINET6 kernel.
A missing else caused the correct resolver hint (AF_INET) to be
overwritten with AF_UNSPEC when the kernel supports IPv4 but not
IPv6.

MFC after:	3 days
PR:		277592
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44304

(cherry picked from commit b53ae8a833)
2024-03-17 14:38:12 +00:00
Gordon Bergling
406f9fd0a7 md5.1: Fix the GNU mode example when using a digest file
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead.

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne, des
Differential Revision:	https://reviews.freebsd.org/D44098

(cherry picked from commit f3343fe4a6)
2024-03-15 10:12:48 +01:00
R. Christian McDonald
9a2b466595 route: introduce add interface route test cases
As a followup to D41330 and D41436, this patch introduces two new tests
for sbin/route: interface_route_v[46].

These tests fail without D41330.

Reviewed by:	kp
Approved by:	kp (mentor)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ca7edd0d2c)
2024-03-14 17:52:50 +08:00
Konstantin Belousov
47ee352ffd mount_nullfs(8): fix typo
(cherry picked from commit bdf1587a49)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
ea8d7263d9 mount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes
(cherry picked from commit 4a2a69c447)
2024-03-13 02:30:41 +02:00
Gordon Bergling
1975c745e3 Revert "md5.1: Fix an example"
This reverts commit 38a5635de9.
2024-03-06 09:33:19 +01:00
Kirk McKusick
fdfb8e783c Eliminate unnecessary UFS1 integrity checks.
The UFS1 integrity checks added in FreeBSD 14 were too aggressive
for UFS1 filesystems created in FreeBSD 4 and 9 systems. This patch
removes those tests which can be done safely since they are not
relevant to the current implementation of UFS1.

This is a follow-on report to bug report 264450 (comments 21-28).

Reported by: slb@sonnet.com
Tested by:   slb@sonnet.com
PR:          264450

(cherry picked from commit b241767f8e)
2024-03-04 16:09:10 -08:00
Stefan Schlosser
38a5635de9 md5.1: Fix an example
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead:

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a  digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D44098

(cherry picked from commit 865baeaf1a)
2024-03-03 18:49:10 +01:00
Stefan Schlosser
ee0ffe0e3e nvmecontrol.8: Fix the SYNOPSIS section
The manpage of nvmecontrol(8) has the following SYNOPSIS:

nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E]
[-C] <device-id | namespace-id>

The correct switch for the pi option is -p according
to sbin/nvmecontrol/format.c:

OPT("pi", 'p', arg_uint32, opt, pi, "Protective information")

So correct the SYNOPSIS section accordingly.

PR:	276554
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44099

(cherry picked from commit 77f6c0ce92)
2024-03-03 18:48:51 +01:00
Dag-Erling Smørgrav
1288891878 md5: Accept "-" as alias for stdin.
(based on a patch by jhb)

MFC after:	1 week
PR:		276915
Reported by:	Hannes Hauswedell <h2+fbsdports@fsfe.org>
Reviewed by:	allanjude, markj, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D43870

(cherry picked from commit 72ee91fed4)

md5: Ignore files in string and passthrough mode.

MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43871

(cherry picked from commit 5b44edb405)

md5: Clean up input stream rights.

Keep it simple, caph_limit_stdio() and fileargs_fopen() already take
care of everything for us.

MFC after:	1 week
Reviewed by:	markj, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D43897

(cherry picked from commit 17d5b027c1)

md5: Add test case for GNU input modes.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43988

(cherry picked from commit e7308a60a5)

md5: Fix Perl mode long options.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43989

(cherry picked from commit 4db7ca2447)

md5: Fix GNU check mode.

Fixes:		9b20849bc5
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43990

(cherry picked from commit c05533d97a)

md5: Untabify declarations.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D43991

(cherry picked from commit 702f133fa1)
2024-02-24 13:12:49 +01:00
Bjoern A. Zeeb
586aaa8ac5 net80211: adjust more VHT structures/fields
Replace ieee80211_ie_vhtcap with ieee80211_vht_cap and
ieee80211_ie_vht_operation with ieee80211_vht_operation.
The "ie" version has the two bytes type/length at the beginning which
we did not actually use as such (the one place doing did just as unused
extra work).

Using the non-"ie" versions allows us to re-use them on shared code.
Using an enum helps us to not accidentally get unsuppored or unhandled
values tough we cannot use it in the struct as we need to ensure the
field width.

ieee80211_vht_operation is guarded by _KERNEL/WANT_NET80211.  While the
header is supposed to be exported to user land historically, software
such as wpa bring their own structure definitions.  For in-tree usage
it is only ifconfig which really cares (at least for now).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian (earlier), cc
Differential Revision: https://reviews.freebsd.org/D42901

(cherry picked from commit e85eb4c8d7)
2024-02-18 18:31:15 +00:00
Ricardo Branco
efec2f0d4e md5: Enter capability mode earlier
Reviewed by:	markj
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/988

(cherry picked from commit 9b20849bc5)
2024-02-15 09:16:07 -05:00
Mark Johnston
92baae0fec route tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week

(cherry picked from commit 2e55256de3)
2024-02-03 14:10:50 -05:00
Warner Losh
3d6778d84e Add kenv .Xr in kldload(8) and loader.conf(5)
Sponsored by:		Netflix

(cherry picked from commit 64db9a0f82)
2024-02-01 18:43:25 +01:00
John F. Carr
63a7e799b3 fsck_msdosfs: do not call checksize() if the cluster is bad
PR:	276464

(cherry picked from commit deeb1d3402)
2024-01-27 11:11:31 +02:00
Mike Karels
7e88d8fec4 route: error on IPv4 network routes with incorrect destination
Route destinations like 10/8 are most likely intended as a shorthand
for 10.0.0.0/8, but instead it means 0.0.0.10/8, which includes
only bits in the host part of the mask, and hence adds a route to
0.0.0.0/8.  In 12.x, there was code to "do what I mean", which was
removed as part of a cleanup of old network class remnants.  Given
that we have gone this long without that code, do not restore that
behavior.  Instead, detect the issue and produce an error.
Specifically, if there are no dots in a numeric IPv4 address, the
mask is specified with CIDR notation (using a slash), and there are
bits set in the host part, produce an error like this for 10/8:

    route: malformed address, bits set after mask; 10 means 0.0.0.10

PR:		258874
Reviewed by:	melifaro, emaste
Differential Revision:	https://reviews.freebsd.org/D43384

(cherry picked from commit b9e8ae1d8a)
2024-01-22 10:42:16 -06:00
Tom Hukins
554b8bc907 Fix "version introduced" in numerous manual pages
Pull request:	https://github.com/freebsd/freebsd-src/pull/853

(cherry picked from commit ba719a0fec)
2024-01-15 10:20:56 -05:00
Kenneth D. Merry
ce6c84abe6 camcontrol: add support for Toshiba drive firmware update
Thanks to Toshiba for providing the SCSI spec for their latest
generation drives so I could confirm how they operate.

The firmware download works in a pretty standard way, so this
is a straightforward table addition.

sbin/camcontrol/camcontrol.8:
	Document that Toshiba drives are supported for fwdownload,
	and that it was tested on TOSHIBA MG10SFA22TE 22TB drives.

sbin/camcontrol/fwdownload.c:
	Add TOSHIBA to the known SCSI vendors list for fwdownload.

Sponsored by:	Spectra Logic

(cherry picked from commit cd95f18c47)
2024-01-03 10:33:12 -05:00
Kenneth D. Merry
31a363933e camcontrol: Add a sense subcommand
As the name suggests, this sends a SCSI REQUEST SENSE to a device,
and prints out decoded sense information.  It can also print out a
hexdump of the sense data.

sbin/camcontrol/camcontrol.c:
	Add the new sense subcommand.

sbin/camcontrol/camcontrol.8:
	Document camcontrol sense.

Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:  https://reviews.freebsd.org/D43225

(cherry picked from commit 40a492d38e)
2024-01-03 09:47:12 -05:00
Dag-Erling Smørgrav
8b55607a7f ping: Simplify protocol selection.
* Interrupt the option loop as soon as we have an indication of which
  protocol is intended.
* If we end up having to perform a DNS lookup, loop over the entire
  result looking for either IPv4 or IPv6 addresses.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	rscheff, kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D42137

(cherry picked from commit 7fd2c91a29)

ping: Consistently use EX_NOHOST for DNS failures.

Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed.
That is still the case for the legacy code in the new merged ping, but
not for IPv6 targets, nor when a DNS lookup is performed in order to
determine which version of the tool to invoke.

While here, also make sure that the error message is consistent.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D42159

(cherry picked from commit c4ffb80ef1)

ping: Add missing ATF boilerplate.

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

(cherry picked from commit fc7143b483)
2023-12-13 17:41:46 +01:00