Commit Graph

10373 Commits

Author SHA1 Message Date
Warner Losh
1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh
2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh
42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
Warner Losh
b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Bjoern A. Zeeb
a1df36f1b9 devmatch: introduce quiet command line option
In setups without hints whatsoever one can get a long list of
"Can't read linker hints file" error messages during boot.
Add a -q/--quiet option which would suppress the noise and leave
space for more essential information.

While here switch to a pre-defined exit code from sysexits.

MFC after:	4 weeks
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D41443
2023-08-15 22:54:48 +00:00
R. Christian McDonald
9f2cddd261 ping: use the in6_addr buffer when parsing src address as AF_INET6
Reviewed by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-08 23:21:49 +02:00
Kristof Provost
f8b4f9aab5 pfctl: optionally clarify which anchors are layer 3 and which are Ethernet
When listing anchors pfctl lists both 'regular' layer 3 anchors and
Ethernet anchors. It's possible to have the same anchor name in both,
which can be confusing.

Mitigate this a little by explicitly marking where the Ethernet anchors
start. Avoid breaking scripts by only doing this at the second level
of verbosity.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-07 19:59:50 +02:00
Mariusz Zaborski
2ea65afbd1 md5: extend capabilites
In 4849767cb1, we did a large refactor of the md5(1) source code.
One of them is that instead of reading data using read(2) syscall, we
are using binary stream input (fread(3)).

fread(3) requires additional Capsicum capabilities:
sha256 CAP operation requires CAP_FSTAT, descriptor holds CAP_READ
sha256 RET fstat -1 errno 93 Capabilities insufficient

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D41348
2023-08-07 14:19:26 +02:00
Kirk McKusick
4ce2a2db41 Update newfs(8) and tunefs(8) manual pages.
Delete note that UFS/FFS filesystems running with journaled soft updates
cannot run background fsck as 344b5bf made it possible to do so.

MFC-with:     344b5bf
Sponsored-by: The FreeBSD Foundation
2023-08-05 23:40:26 -07:00
Kirk McKusick
02b7bf07c5 Improve dumpfs(8) error messages when a cylinder group read fails.
Previously dumpfs(8) exited when a cylinder group read failed (such
as a cylinder-group check-hash failure). Now an error message
indicating the cylinder group number and the type of failure is
printed and the output continues for the remaining cylinder groups.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-08-05 23:10:15 -07:00
Andrius V
abe10d21b4 nvmecontrol: fix typos
PR:		261911
Reviewed by:	kp
2023-08-03 12:14:19 +02:00
Kirk McKusick
344b5bf825 Support background fsck_ffs(8) on filesystems using journaled soft updates
An earlier addition of code to fsck_ffs(8) allowed it to support
snapshots when running with journalled soft updates. Further
functionality has now been added to fsck_ffs(8) to allow it to use
snapshots to run in background on live filesystems running with
journaled soft updates. This commit enables the use of this functionality.

Tested-by:    Peter Holm
Sponsored-by: The FreeBSD Foundation
MFC-after:    2 weeks
2023-08-01 13:17:02 -07:00
Mark Johnston
a94158d255 dhclient tests: Serialize pcp tests 2023-07-31 11:01:43 -04:00
Kirk McKusick
6f0ca273a3 Add diagnostics to fsck_ffs(8) for journaled soft-updates debugging.
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-07-26 14:50:02 -07:00
Kirk McKusick
d059e44b80 Add quitclean command to fsdb(8) to request a filesystem not be marked dirty.
A new command, quitclean, is added to fsdb(8) to request that the
filesystem not be marked as needing a full fsck(8). This is useful
when creating deliberately bad filesystem images to be used to check
that fsck is properly able to clean them up.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-07-25 19:42:41 -07:00
Kirk McKusick
d51bdf327d Have fsdb(8) only mark a filesystem dirty when it is modified.
Until this update, the fsdb(8) command always marked a filesystem
as needing a full fsck unless it was run with the -n flag which
allowed no changes to be made.

This change tracks modifications to the filesystem. Two types of
changes are tracked. The first type of changes are those that are
not critical to the integrity of the filesystem such as changes to
owner, group, time stamps, access mode, and generation number. The
second type of changes are those that do affect the integrity of
the filesystem including zeroing inodes, changing block pointers,
directory entries, link counts, file lengths, file types, and file
flags.

When quitting having made no changes or only changes to data that
is not critical to filesystem integrity, the clean state of the
filesystem is left unchanged. But if filesystem critical data are
changed then fsdb will set the unclean flag which will require a
full fsck to be run before the filesystem can be mounted.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-07-25 19:29:05 -07:00
Kirk McKusick
4d512b0735 Debugging output additions. No functional changes intended.
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-07-25 14:03:43 -07:00
Warner Losh
efff068cbf camcontrol: Migrate to modern uintXX_t from u_intXX_t
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
move to the modern uintXX_t.

MFC After:	3 days
Sponsored by:	Netflix
2023-07-24 21:32:57 -06:00
Kristof Provost
010ee43f56 pf: initial SCTP support
Basic state tracking for SCTP. This means we scan through the packet to
identify the different chunks (so we can identify state changes).

MFC after:	3 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D40862
2023-07-21 12:32:18 +02:00
Kristof Provost
0bd4a6837c pfctl: SCTP can have port numbers
MFC after:	3 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D40861
2023-07-21 12:32:18 +02:00
Navdeep Parhar
a29916a6f8 ifconfig_netlink.c: whitespace cleanup.
No functional change.
2023-07-20 10:54:56 -07:00
Navdeep Parhar
88284368fa ifconfig: Shift unsigned value to avoid UB.
Reported by:	kib@
2023-07-20 10:54:56 -07:00
Navdeep Parhar
47b1fef6fb ifconfig: Fix the display of capabilities in the netlink based code.
The capabilities in if_capabilities2/if_capenable2 are reported in the
second 32b and were not being displayed correctly.  v does not need to
be advanced because v[i / 32] is the correct 32b value already.

Sponsored by:	Chelsio Communications

Reviewed by:	kib@
Differential Revision:	https://reviews.freebsd.org/D41107
2023-07-20 10:26:18 -07:00
Kirk McKusick
239597e030 Text format cleanups. No functional changes intended.
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-07-17 17:29:09 -07:00
R. Christian McDonald
4b426cf3a4 libbe: recursively promote deep BE datasets
beadm will recursively promote deep BE datasets. In order to match the
beadm behavior, we need to recursively iterate over child filesystems
and promote them along the way.

This patch further refines the work from D40903, completing the fix for
promotion.

Reviewed by:	kevans, rew
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D40972
2023-07-17 14:08:32 -05:00
John Baldwin
39248950a0 nvmecontrol.8: Fix a few formatting nits. 2023-07-13 17:10:36 -07:00
Luiz Amaral
6fc7fc2dbb pfsync: transport over IPv6
Implement pfsync over IPv6.

Submitted by:	Luiz Amaral <email@luiz.eng.br>
Submitted by:	Naman Sood <naman@freebsdfoundation.org>
Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D40102
2023-07-13 08:09:42 +02:00
Kyle Evans
5d0826017f libbe: promote activated BEs all the way
This matches the beadm behavior; generally, we need to keep promoting
until the BE is no longer a clone from a snapshot.  This fixes scenarios
where the dataset associated with a BE's origin is itself a clone,
activating the BE previously would promote it to a clone of the origin's
origin.

We could keep using be_get_dataset_props here, except for two
annoyances:

1.) I couldn't find a clean way to just clear an nvlist rather than
    having to re-alloc it, and I didn't want to just remove the one prop
    we're inspecting out of it.

2.) That's a lot of overhead when all we want to do is fetch the origin
    anyways.

Note that this is not a complete fix, but it does fix the majority of
cases; deep BE subordinates are still notably broken, pending a patch
from Christian.

Reported by:	R. Christian McDonald <rcm@rcm.sh>
Reviewed by:	rew
Differential Revision:	https://reviews.freebsd.org/D40903
2023-07-11 00:44:13 -05:00
Eric van Gyzen
eb8d2e123d dhclient: fix build on i386
Only i386 still uses a 32-bit time_t.  I knew this, and I still failed
to compile-test on i386.  My bad.

Reported by:	cy
Fixes:		c210cac00f ("dhclient: fix time parsing for leases...")
Sponsored by:	Dell EMC Isilon
2023-07-10 15:03:39 -05:00
Alex Bahm
c210cac00f dhclient: fix time parsing for leases expiring after 2038
Convert lease parsing to timegm to calculate timestamp. For reference, when
writing the lease, we use gmtime to convert the timestamp to struct tm.

Reviewed By:	markj, vangyzen
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D40760
2023-07-10 11:00:34 -05:00
Jessica Clarke
1e635e87e3 ldconfig: Use __PATH_ELF_HINTS("32") over _PATH_ELF32_HINTS
This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by:	kib, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40933
2023-07-09 18:50:15 +01:00
Alfonso Gregory
65f3be9110 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:17 -06:00
Mateusz Guzik
e01f9fe10c ipf: low-effort fix to make it compilable without inet6 2023-07-05 10:02:32 +00:00
Mateusz Guzik
cea9f49f82 ping: low-effort fix to make it compilable without inet 2023-07-05 10:02:32 +00:00
Mateusz Guzik
55e0aefae6 ping: low-effort fix to make it compilable without inet6 2023-07-05 10:02:32 +00:00
Alfonso Gregory
27cebb4eac newfs: nextnum should be a u_int32_t, not an int
The function that uses nextnum expects to return a u_int32_t, not a mere
int, so let's make nextnum a u_int32_t instead.

Note: retained current u_int32_t style, since the rest of the file uses
it.

Reviewed by: imp, mckusick
Pull Request: https://github.com/freebsd/freebsd-src/pull/734
2023-06-28 16:26:06 -06:00
Alfonso Gregory
430168942f newfs: prefer unsigned index over signed
We can just use a for loop starting at 0 instead of a while loop
starting at -1.

Reviewed by: imp, mckusick
Pull Request: https://github.com/freebsd/freebsd-src/pull/733
2023-06-28 16:18:47 -06:00
Graham Perrin
6927176113 bectl(8): clarifications, expansion
Reviewed-by:  imp
Pull-request: https://github.com/freebsd/freebsd-src/pull/728
2023-06-28 03:05:26 +01:00
Alfonso Gregory
21c32cebf8 ifconfig: skip calling fnmatch once the result no longer matters
Because fnmatch has no side effects, we can safely avoid calling fnmatch
if the end result does not matter anyway (the compiler cannot see this,
so it calls fnmatch in the event it has side-effects).

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/747
2023-06-27 16:28:44 -06:00
John Baldwin
90f2fee0e0 ipf: Remove set but unused variables.
Reported by:	clang
Differential Revision:	https://reviews.freebsd.org/D40667
2023-06-27 10:19:32 -07:00
John Baldwin
f5e7330633 ipfw: Remove set but unused variables.
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D40654
2023-06-27 10:19:32 -07:00
John Baldwin
a7f25f141a libipf: Remove set but unused variable from printfraginfo().
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D40652
2023-06-27 10:19:31 -07:00
Ed Maste
c079bcbc60 ifconfig: consistently sort set/clear commands
Sponsored by:	The FreeBSD Foundation
2023-06-25 16:09:26 -04:00
Koichiro Iwao
9aca30d878 ifconfig.8: Document limitation of groupname
Approved by:		kp
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D40645
2023-06-20 23:08:04 +09:00
Warner Losh
6bd922e154 camcontrol: Include stdbool.h rather than relying on namespace pollution
I have several environments, and at least one of them fails to build
because bool is undefined. Since we use bool, always include stdbool.h
rather than relying on any indirect definitions to pull it in.

Sponsored by:		Netflix
2023-06-19 14:54:32 -06:00
Warner Losh
90f05f6840 camcontrol: Zone fix two warnings
Remove a set but never used variable, and use the protocol variable for
its intended purpose.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D40528
2023-06-19 14:51:07 -06:00
Warner Losh
e8cdabb4e1 camcontrol: In defects make -S actually imply 12-byte command
camcontrol(8) says that -S to start at a different offset implies that
we're using the 12 byte command. But really, we're using the 10-byte
command. Fix this by setting use_12byte for -S.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D40526
2023-06-19 14:45:43 -06:00
Warner Losh
2e105b61e9 camcontrol: simplify summary logic for defects
We don't need to count the number of lists requested. Instead, use the
more general form of checking to see if any of the non-defect format
bits are set. Also, check summary boolean to control summary reporting
behavior.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D40524
2023-06-19 14:45:43 -06:00
Warner Losh
f20d86e171 camcontrol: No need to set CAM_ARG_[PG]LIST in defects
We can or in the the list_format bits directly if we or in the
list_format when we look it up the first time. Free up CAM_ARG_[PG]LIST
from the CAM_ARG_xxx enum.

Sponsored by:		Netflix
Reviewed by:		mav (I made his suggested change)
Differential Revision:	https://reviews.freebsd.org/D40523
2023-06-19 14:45:43 -06:00
Warner Losh
97e24c3868 camcontrol: Simplfiy 12-byte retry logic in defects command
We always start out using the 10-byte version of READ DEFECT DATA, and
then switch to 12-byte when necessary due to errors or data length
requirements. We always need to get the length again when we do this,
and we're always going to be using 12-byte commands from that point
forward. Simplify the logic a bit based on this observation.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D40522
2023-06-19 14:45:43 -06:00