Commit Graph

10231 Commits

Author SHA1 Message Date
Kirk McKusick
689a9368eb Fix types for fsck_ffs(8) i386 build.
Reported by:  jenkins
Reported by:  Cy Schubert
Sponsored by: The FreeBSD Foundation
2022-11-09 18:31:19 -08:00
Luiz Amaral
813c5b75e6 pfsync: prepare code to accommodate AF_INET6 family
Work is ongoing to add support for pfsync over IPv6. This required some
changes to allow for differentiating between the two families in a more
generic way.

This patch converts the relevant ioctls to using nvlists, making future
extensions (such as supporting IPv6 addresses) easier.

Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D36277
2022-11-09 21:06:07 +01:00
Kirk McKusick
460ed6106c Add support for managing UFS/FFS snapshots to fsck_ffs(8).
The kernel handles the managment of UFS/FFS snapshots. Since UFS/FFS
updates filesystem data (rather than always writing changes to new
locations like ZFS), the kernel must check every filesystem write
to see if the block being written is part of a snapshot. If it is
part of a snapshot, then the kernel must make a copy of the old
block value into a newly allocated block for the snapshot before
allowing the write to be done. Similarly, if a block is being freed,
the kernel must check to see if it is part of a snapshot and let
the snapshot claim the block rather than freeing it for future use.
When a snapshot is freed, its blocks need to be offered to older
snapshots and freed only if no older snapshots wish to claim them.

When snapshots were added to UFS/FFS they were integrated into soft
updates and just a small part of the management of snapshots needed
to be added to fsck_ffs(8) as soft updates minimized the set of
snapshot changes that might need correction. When journaling was
added to soft updates a much more complete knowledge of snapshots
needed to be added to fsck_ffs(8) for it to be able to properly
handle the filesystem changes that a journal rollback needs to do
(specifically the freeing and allocation of blocks). Since this
functionality was unavailable, the use of snapshots was disabled
when running with journaled soft updates.

This set of changes imports the kernel code for the management of
snapshots to fsck_ffs(8). With this code in place it will become
possible to enable snapshots when running with journalled soft
updates. The most immediate benefit will be the ability to use
snapshots to take consistent filesystem dumps on live filesystems.
Future work will be done to update fsck_ffs(8) to be able to use
snapshots to run in background on live filesystems running with
journaled soft updates.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36491
2022-11-09 10:46:31 -08:00
Kirk McKusick
f515a279f7 Clean up error output for extended attributes in fsck_ffs(8).
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2022-11-07 14:32:42 -08:00
Gordon Bergling
e0dfa1c4c4 shutdown.8: Add a note about needed priviledges to run the command
In order to use the shutdown command, the user must
have root privileges or be a member of the operator group.

PR:		266525
Reported by:	Zsolt Udvari <uzsolt at uzsolt hu>
Reviewed by:	pauamma
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36688
2022-11-07 12:00:11 +01:00
Jose Luis Duran
d481443acb ping_test: Fix tests ping_46 and ping6_46
If no IPv4-host, IPv4-mcast-group or IPv6-host is passed, it will
display the usage.  The tests are passing because they are just checking
that the exit code is 1.

Fix the tests by checking the appropriate output message.

While here, change the description to match the output and add the
missing requirements.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37250
2022-11-03 10:39:32 -04:00
Jose Luis Duran
fcae0b54d1 ping_test: Code cleanup
Mostly style fixes.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37248
2022-11-03 10:39:32 -04:00
Jose Luis Duran
909e2e1b6c ping: Remove a vestigial notdef
It was once a function on 4.3BSD, pr_type() [1], used to convert an ICMP
"type" field to a printable string.  In 4.4BSD it was superseded by
pr_icmph() [2].

NetBSD [3] and OpenBSD [4] have already removed it.

[1]: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/src/etc/ping.c
[2]: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/sbin/ping/ping.c
[3]: 203dfd3486
[4]: 9bbbbbb75d

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37247
2022-11-03 10:39:32 -04:00
Jose Luis Duran
526e8a7d5d ping: main.c: Consistent use of white space/tabs
If a user has tabs set at a value other than 8, the output of the usage
may not be consistently aligned.

    % tabs -2

Before:
    % ping
    usage:
      ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize]
          [-g sweepminsize] [-h sweepincrsize] [-i wait] [-l preload]
          [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
          [-s packetsize] [-t timeout] [-W waittime] [-z tos] IPv4-host
      ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait]
          [-l preload] [-M mask | time] [-m ttl] [-P policy] [-p pattern]
          [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
                [-z tos] IPv4-mcast-group
      ping [-6AaDdfHnNoOquvyY] [-b bufsiz] [-c count] [-e gateway]
                [-I interface] [-i wait] [-k addrtype] [-l preload] [-m hoplimit]
                [-p pattern] [-P policy] [-S sourceaddr] [-s packetsize] [-t timeout]
          [-W waittime] [-z tclass] [IPv6-hops ...] IPv6-host

After:
    % ping
    usage:
      ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize]
          [-g sweepminsize] [-h sweepincrsize] [-i wait] [-l preload]
          [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
          [-s packetsize] [-t timeout] [-W waittime] [-z tos] IPv4-host
      ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait]
          [-l preload] [-M mask | time] [-m ttl] [-P policy] [-p pattern]
          [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
          [-z tos] IPv4-mcast-group
      ping [-6AaDdfHnNoOquvyY] [-b bufsiz] [-c count] [-e gateway]
          [-I interface] [-i wait] [-k addrtype] [-l preload] [-m hoplimit]
          [-p pattern] [-P policy] [-S sourceaddr] [-s packetsize] [-t timeout]
          [-W waittime] [-z tclass] [IPv6-hops ...] IPv6-host

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37246
2022-11-03 10:39:32 -04:00
Pau Amma
5cc5c9254d Make SYNOPSIS match DESCRIPTION.
While there, fix nits reported by igor and mandoc -T lint.

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

Reviewed by:	debdrup, gbe, gjb

Approved by:	gjb (mentor)

MFC after:	3 days
2022-11-03 00:20:12 +01:00
Kristof Provost
8a8af94240 pf: bridge-to
Allow pf (l2) to be used to redirect ethernet packets to a different
interface.

The intended use case is to send 802.1x challenges out to a side
interface, to enable AT&T links to function with pfSense as a gateway,
rather than the AT&T provided hardware.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37193
2022-11-02 15:45:23 +01:00
Kristof Provost
9f8f3a8e9a ipsec: add support for CHACHA20POLY1305
Based on a patch by ae@.

Reviewed by:	gbe (man page), pauamma (man page)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37180
2022-11-02 14:19:04 +01:00
Ed Maste
6659516b1a mount_unionfs: remove jokey cautions from man page
There are known issues with unionfs, and the mount_unionfs man page has
a cautionary statement about its use.  The caution had additional
"humourous" statements like "BEWARE OF DOG" but they served only to
confuse the situation.  Remove them.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-10-31 16:52:54 -04:00
Kristof Provost
444a77ca85 pf: expose syncookie active/inactive status
When syncookies are in adaptive mode they may be active or inactive.
Expose this status to users.

Suggested by:	Guido van Rooij
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-10-31 18:14:09 +01:00
Kirk McKusick
595746df6f Additional diagnostic output when running fsck_ffs with debugging flag (-d)
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2022-10-30 15:00:20 -07:00
Emmanuel Vadot
e7a5a60ed5 pkgbase: Put devmatch in its own package
devmatch is useful on standalone machine but not on jails.
Put devinfo(8) and libdevinfo there too.

Differential Revision:	https://reviews.freebsd.org/D36229
2022-10-26 19:46:38 +02:00
Emmanuel Vadot
ea0850e4be pkgbase: Put devd in its own package
It's not that useful in a jail or in a mdroot.

Differential Revision:	https://reviews.freebsd.org/D36228
2022-10-26 19:46:36 +02:00
Emmanuel Vadot
a7ffc94849 pkgbase: Put ufs related tools and lib in their own package
It's not really useful in a jail or in a mdroot or even if a users
wants to do a full zfs machine.

Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D36227
2022-10-26 19:46:34 +02:00
Emmanuel Vadot
a71ea7bea0 pkgbase: Put zfs utilities and lib in their own package
It is useful to have zfs utilities and lib in a separate package as
it allow users to create image that can support ZFS (i.e. not with
WITHOUT_ZFS in src.conf set) without bloating the default image with
all zfs tools (for example for jails).

Differential Revision:	https://reviews.freebsd.org/D36225
2022-10-26 19:46:30 +02:00
Emmanuel Vadot
0bf688786f pkgbase: Put geom utilities in their own package
For most users it's not needed to boot and they are also
available in the FreeBSD-rescue package in case an update
break and FreeBSD-geom package isn't updated correctly.

Differential Revision:	https://reviews.freebsd.org/D36224
2022-10-26 19:46:28 +02:00
Emmanuel Vadot
6987b552dd pkgbase: Put resolvconf in its own package
It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Differential Revision:	https://reviews.freebsd.org/D36223
2022-10-26 19:46:26 +02:00
Emmanuel Vadot
ab4bd66752 pkgbase: Put dhclient in its own package
It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D36222
2022-10-26 19:46:24 +02:00
Emmanuel Vadot
5f9db65d8a pkgbase: Put nvmecontrol in its own package
It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D36221
2022-10-26 19:46:22 +02:00
Kirk McKusick
243a0eda9a Increase the maximum size of the journaled soft-updates journal.
The size of the journaled soft-updates journal should be big enough
to hold two minutes of filesystem metadata-update activity. The
maximum size of the soft updates journal was set in the 1990s. At
the time it was assummed that disk arrays would top out at 16 drives
and disk writes per drive would top out at 500 per second. Today's
I/O subsystems are considerably bigger and faster than those limits.
Thus this delta removes the hard upper limit and lets tunefs(8) and
newfs(8) set the upper bound based on the size of the filesystem and
its cylinder groups.

Sponsored by: The FreeBSD Foundation
2022-10-21 11:00:00 -07:00
Kirk McKusick
0929a153fc Add a description of soft updates journaling to newfs(8).
Add a descrition to the newfs(8) -j (journal enablement) flag
that explains what soft updates journaling does, the tradeoffs
to using it, and the limitations that it imposes. Copied from
the description in tunefs(8).

PR:           261944
Sponsored by: The FreeBSD Foundation
2022-10-21 10:57:31 -07:00
Sebastien Bini
f3dba162bd init: allow to start script executions with sh -o verify
On systems where mac_veriexec is enforced, init should run its scripts in verified mode.
This relies on the verify shell option introduced by D30464. init will detect if the shell
is /bin/sh, and in which case, add the verify option to the argument vector.
The verify option propagates to all files sourced by the shell, ensuring a better
protection than if the script was tested against an open(O_VERIFY) before running it.
This security can be bypassed with the kenv which overloads the shell to use.
However we feel confident that on systems running with mac_veriexec, this kenv will be blocked somehow.
Also, the verify option has no effect on systems where mac_veriexec is not loaded nor enforced.

Differential revision:  https://reviews.freebsd.org/D34622
Reviewed by:		sjg, wma
2022-10-11 09:48:04 +02:00
Cy Schubert
1fcc50004c ipfilter: Removed unused ioctl typedef
Defunct operating systems no longer pollute the ipfilter sources. Remove
their typedefs.

MFC after:	1 week
2022-10-08 17:28:04 -07:00
Warner Losh
2da6a6b31d nvmecontrol: use uintmax_t for a size
Use uintmax_t cast to print the size of the device for the non-humanize
case to avoid issues with 32-bit longs.

Fixes:			9c1bec9c21
Sponsored by:		Netflix
2022-10-07 21:44:23 -06:00
Wanpeng Qian
9c1bec9c21 nvmecontrol: improve namespace size unit of devlist command output
Add an option of -h --human to output human readable size unit instead
of the fixed unit (MB).

Signed-off-by:		Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by:		imp, bcr
Differential Revision:	https://reviews.freebsd.org/D32957
2022-10-07 17:59:20 -06:00
Cy Schubert
142c3c7fef nvmecontrol: Apply cast
The proper fix also casts to uintmax_t.

Reported by:	imp
Fixes:		a7b568109e
2022-10-06 11:58:16 -07:00
Cy Schubert
a7b568109e nvmecontrol: Fix i386 build
Fix:

--- all_subdir_sbin ---
/opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:149:64:
error: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
        printf("   Read Reclaim Count                       : %lu\n",
le64dec(&temp->rrc));
                                                              ~~~
^~~~~~~~~~~~~~~~~~~
                                                              %llu
/opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:150:64:
error: forma t specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
        printf("   Lifetime Uncorrectable ECC Count         : %lu\n",
le64dec(&temp->lueccc));
                                                              ~~~
^~~~~~~~~~~~~~~~~~~~~~
                                                              %llu
2 errors generated.

Fixes:		84e8678870
2022-10-06 11:26:50 -07:00
Wanpeng Qian
84e8678870 nvmecontrol: Add Samsung Extended SMART Information logpage support
Samsung PM983 SSD has a 0xca logpage. It has more information compared
to Intel's this patch tested on PM983 M2 SSD and works as expected.

Reviewed by:		imp@
Approved by:		kp@
Event:			Aberdeen Hackathon 2022
Differential revision:	https://reviews.freebsd.org/D33749
2022-10-06 10:24:02 +00:00
Kristof Provost
1d090028d3 pf: use time_to for timestamps
Use time_t rather than uint32_t to represent the timestamps. That means
we have 64 bits rather than 32 on all platforms except i386, avoiding
the Y2K38 issues on most platforms.

Reviewed by:	Zhenlei Huang
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36837
2022-10-05 17:52:27 +02:00
Kristof Provost
fd6ecc184d dhclient-script: cope with /32 address leases
On certain cloud platforms (Google Cloud, Packet.net and others) the
DHCP server offers a /32 address. This makes adding the default route
fail since it is not reachable via any interface. Linux's
dhclient-script seem to usually have a special case for that and
explicitly adds an interface route to the router's address.

FreeBSD's dhclient-script already has a special case for when the router
address is the same as the leased address. Now also add one for when
it's a different address that doesn't fall in the interface's subnet.

PR:		241792
Event:		Aberdeen hackathon 2022
Submitted by:	sigsys@gmail.com
Reviewed by:	dch, kp, bz (+1 on the idea, not reviewed), thj
MFC after:	1 week
2022-10-05 12:24:31 +02:00
John Baldwin
1187e46d1b nvmecontrol wdc: Don't pass a bogus pointer to free().
wdc_get_dui_log_size allocates a buffer and then advances the
returned pointer.  Passing this advanced pointer to free() is UB,
so save the original pointer to pass to free() instead.

Reviewed by:	imp
Reported by:	GCC 12 -Wfree-nonheap-object
Differential Revision:	https://reviews.freebsd.org/D36827
2022-10-03 16:10:44 -07:00
John Baldwin
d81082a7ad nvmecontrol wdc: Remove unused but set variable.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D36812
2022-10-03 16:10:42 -07:00
John Baldwin
d74024a490 pfctl: Fix mismatch in array bounds for pfr_next_token().
Reviewed by:	kp, emaste
Differential Revision:	https://reviews.freebsd.org/D36806
2022-10-03 16:10:41 -07:00
Rick Macklem
0083eef31c mount_nfs.8: Fix the RFC number now that it exists
The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after:	1 week
2022-09-24 15:05:21 -07:00
Pau Amma
f968cb140f Track removal of Tokenring and FDDI media types from devd.cc.
Fixes:	eec02418d8 Remove support for FDDI and token ring media types in userland utilities.

Reviewed by:	brooks, gjb, imp

Approved by:	brooks (src), gjb (mentor, src), imp (src)

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

MFC after:	3 days
2022-09-23 10:32:49 +02:00
Cy Schubert
00d8a28f19 ipfilter/libipf: printpool_live() consumer ignores return code
The single consumer of printpool_live() ignores the return code.
Avoid wasting resources on this.

MFC after:	2 weeks
2022-09-22 15:38:12 -07:00
Cy Schubert
5568c8b2c5 ipfilter/ippool: Return error code when listing a pool fails
When an internal or other error occurs during the listing of a pool,
return an error code when extiting ippool(8). Printing an error to
stderr without returning an error code is useless in shell scripts.

MFC after:	2 weeks
2022-09-22 15:38:11 -07:00
Cy Schubert
7531c434a5 ipfilter/ippool: Dump a copy of ippool in ippool.conf format
Add an ippool(8) option to dump a copy of the inm-memory ippool tables
in an ippool(5) format so that it can be reloaded using ippool -f.

MFC after:	2 weeks
2022-09-22 15:38:11 -07:00
Bram Ton
06bfd0b914 setkey.8: Improve direction descriptions
Be more precise in the definition of policy directions
and policy levels.

PR:		250177
Reported by:	Bram Ton <bram at cbbg dot nl>
Reviewed by:	gbe, ae
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26719
2022-09-13 13:16:48 +02:00
Rick Macklem
9b436906fa mount_nfs.8: Update for NFSv4 use of "nolockd"
Commit 33721eb991 enabled use of "nolockd" for
NFSv4 mounts.  This was done primarily to allow its
use with the "intr" mount option.

This patch updates the man page for this.

This is a content change.

Reviewed by:	gbe (manpages), karels
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36462
2022-09-07 14:07:20 -07:00
Kirk McKusick
2567b60f62 Fix for f4fc389.
Need to check for NULL pointer before using.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-09-06 16:22:03 -07:00
Kirk McKusick
2ddf8cdbe0 Clarify error messages about bad inodes.
When something was found wrong with an inode the error message
was always "UNKNOWN FILE TYPE". This error is now used only when
the file type field is wrong. Other errors have their own messages:
"BAD FILE SIZE", "NEGATIVE FILE SIZE", "BAD SPECIAL-FILE RDEV",
"INVALID DIRECT BLOCK", and "INVALID INDIRECT BLOCK".

More complete information about the inode is also provided.

Sponsored by: The FreeBSD Foundation
2022-09-06 16:17:11 -07:00
Bjoern A. Zeeb
ac606903a8 ifconfig: print interface name on SIOCIFCREATE2 error
We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
(usually "Device not configured").  This can happen if there is
configuration for interfaces in rc.conf which do not (yet) exist and
we try to configure.  I can, e.g., provoke this by configuring wlan
interfaces with their physical interface not installed.
In order to cut support (guesswork) down print the name of the
interface to be configured with the error message.
Hopefully this will help us in the future to improve other configuration
or driver problems.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-09-06 13:09:39 +00:00
Kristof Provost
cfa1a13087 pfctl: fix recrusive printing of ethernet anchors
Similar to the preceding fix for layer three rules, ensure that we
recursively list wildcard anchors for ethernet rules.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36417
2022-09-06 13:19:10 +02:00
Kristof Provost
585a5ed0be pfctl: fix recrusive printing of anchors
Fix a couple of problems with printing of anchors, in particular recursive
printing, both of inline anchors and when requested explicitly with a '*'
in the anchor.
- Correct recursive printing of wildcard anchors (recurse into child anchors
rather than rules, which don't exist)
- Print multi-part anchor paths correctly (pr6065)
- Fix comments and prevent users from specifying multi-component names for
inline anchors.

tested by phessler
ok henning

Also fix the relevant pfctl test case to reflect the new (and now
correct) behaviour).

MFC after:	3 weeks
Obtained from:	OpenBSD (mcbride, f9a568a27c740528301ca3419316c85a9fc7f1de)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36416
2022-09-06 10:42:10 +02:00
Kristof Provost
ed5eb77e18 pfctl: fix printing anchors
Ensure that we pass the (base) anchorname to the kernel, not the '/*'
suffix.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36415
2022-09-06 10:42:09 +02:00
Corvin Köhne
203f2c14c4 init: fix shutdown race
When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 and init calls death_single. If shutdown
wins the race, wpid will be set to the pid of the shutdown process and
the requested_transition will be ignored.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D36356
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2022-09-06 09:06:51 +02:00
Kirk McKusick
4b4cc78a76 Formatting cleanups and debugging fix.
Sponsored by: The FreeBSD Foundation
2022-09-05 12:07:48 -07:00
Gordon Bergling
eec35f1fb3 ping(8): Correct a typo in source code comment
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:26:34 +02:00
Gordon Bergling
b89592a9ef ipf.4: Correct a typo in the manual page
- s/occured/occurred/

MFC after:	3 days
2022-09-04 12:55:42 +02:00
Kirk McKusick
2aa6ed881d Fix printf formating.
Fix for f4fc389.

Reported by:  Jenkins
Sponsored by: The FreeBSD Foundation
2022-09-03 15:39:45 -07:00
Kirk McKusick
f4fc389524 Properly handle the replacement of a partially allocated root directory.
If the root directory exists but has a bad block number Pass1 will
accept it and setup an inoinfo structure for it. When Pass2 runs
and cannot read the root inode's content because of a bad (or
duplicate) block number, it removes the bad root inode and replaces
it. As part of creating the replacement root inode, it creates an
inoinfo entry for it. But Pass2 did delete the inoinfo entry that
Pass1 had set up for the root inode so ended up with two inoinfo
structures for it. The final step of Pass2 checks that all the ".."
entries are correct adding them if they are missing which resulted
in a second ".." entry being added to the root directory which
definitely did not go over well in the kernel name cache!

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-09-03 14:48:34 -07:00
Kirk McKusick
cf17c2ff11 Flush and close getnextino cache when done using it in Pass 1b.
Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-09-03 14:15:50 -07:00
Gordon Bergling
2f2cf766b2 ifconfig(8): Fix a typo in source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 14:55:54 +02:00
Rick Macklem
f46bea05fe mount_nfs.8: Reword sentence so .Pa macro works
Commit 603677334a added a sentence with a file path
in it. However, it did not use .Pa since it would leave
a space after it, where ('s) was supposed to go.

This patch rewords the sentence so that .Pa can
be used.

This is a content change.

Suggested by:	mkarels
2022-08-31 16:19:22 -07:00
Gleb Smirnoff
1df08e905a natd: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT 2022-08-30 16:24:37 -07:00
Rick Macklem
603677334a mount_nfs.8: Note that NFSv4 requires unique /etc/hostid's
Recent problems related to NFSv4 mounts has been traced
to multiple NFSv4 clients using the same /etc/hostid
(or kern.hostuuid, if you prefer).

This patch adds a sentence to the man page noting that
clients must have unique /etc/hostid's.

This is a content change.

Reviewed by:	gbe (manpages)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36392
2022-08-30 07:57:27 -07:00
Kirk McKusick
827622937e Correct calculation of inode location in getnextino cache.
Fix for 345bfec.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-28 23:47:17 -07:00
Kirk McKusick
2e4da012d5 Correct calculation of inode location in getnextino cache.
Fix for 345bfec.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-28 23:09:29 -07:00
Kirk McKusick
27c6009e72 Correct diagnostic messages for bad cylinder groups.
Fix for 495b1ba.

Reported by:  Mike Karels
Sponsored by: The FreeBSD Foundation
2022-08-26 00:31:44 -07:00
Kirk McKusick
495b1baac3 Provide better diagnostic messages for bad cylinder groups.
Like the detailed diagnostics produced when a bad superblock
is read, provide similar detailed diagnostics when bad
cylinder groups are read.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-25 23:57:56 -07:00
Kirk McKusick
345bfec109 Provide cache coherency between getnextinode() and ginode()
The fsck_ffs(8) utility has two subsystems for reading and writing
inodes. The getnextinode() interface is used in Pass 1 (and Pass
1b if needed) to sequentially walk through all the inodes in the
filesystem. The ginode() interface is used to read and write
individual inodes. Pass 1 uses a mix of both interfaces. This
change ensures that ginode() returns a pointer to the inode in the
cache maintained by getnextinode() when that interface holds the
requested inode so that all modifications to the inode are made in
a single place and are all written to the disk together.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-23 23:48:40 -07:00
Kirk McKusick
be639cc8ee Update standard superblock when successful using an alternate superblock.
Historically fsck_ffs(8) would only use alternate superblocks when
running in manual mode. When the standard superblock fails, it now
tries to find and use a backup superblocks even when running in `preen'
mode. If an alternate superblock is found and the filesystem is
successfully cleaned up using it, write the alternate superblock
back to the standard superblock so that the filesystem can be
subsequently mounted and used.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-23 23:29:17 -07:00
Kirk McKusick
6bae6625e0 Improve handling of missing '.' and '..' in UFS directories.
The UFS filesystem expects to find '.' and '..' as the first two entries
in a directory. The kernel's UFS name cache can become quite confused
when these two entries are not present as the first two entries.

Prior to this change, when the fsck_ffs(8) utility detected that
'.' and/or '..' were missing, it would report them, but only offered
to replace them if the space at the beginning of the directory was
available. Otherwise it was left to the system administrator to
move the offending file(s) out of the way and then rerun fsck_ffs(8)
to create the '.' and '..' entries.

With this change, fsck_ffs(8) will always be able to create the '.'
and/or '..' entries. It moves any files in the way elsewhere in the
directory block. If there is no room in the directory block to which
to move them, they are placed in the lost+found directory.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-17 14:19:59 -07:00
Kirk McKusick
4f9606c9a6 When reading backup UFS superblocks, report reason if they cannot be used.
When either searching for backup UFS superblocks or when explicitly asked
to use one with the -b option, report the reason for failure if it cannot
be used.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-17 13:54:07 -07:00
Jens Schweikhardt
3c405c7e83 Indicate which port gdb.1 and kgdb.1 come from. 2022-08-17 19:13:22 +02:00
Gleb Smirnoff
05b9737f10 ipfw: make it possible to specify MTU for "unreach needfrag" action
Reviewed by:		ae, pauamma
Differential revision:	https://reviews.freebsd.org/D36140
2022-08-17 08:24:11 -07:00
Kirk McKusick
128b0398a1 Update date in tunefs(8) manual page.
Requested by: Li-Wen Hsu
PR:           261944
Sponsored by: The FreeBSD Foundation
2022-08-16 16:46:59 -07:00
Emmanuel Vadot
4efb514b70 pkgbase: Put mount_nfs in the FreeBSD-nfs package 2022-08-16 21:15:04 +02:00
Kirk McKusick
82493ff700 Add a description of soft updates journaling to tunefs(8).
Add a descrition to the tunefs(8) -j (journal enablement) flag
that explains what soft updates journaling does, the tradeoffs
to using it, and the limitations that it imposes.

Requested by: Graham Perrin
PR:           261944
Sponsored by: The FreeBSD Foundation
2022-08-15 13:45:48 -07:00
Jens Schweikhardt
016aeb7ca0 The fdformat man page is in section 8 (not 1). 2022-08-14 18:14:52 +02:00
Jens Schweikhardt
8b55a4718c Indicate that racoon.8 is in ports/security/ipsec-tools. 2022-08-14 15:55:34 +02:00
Jens Schweikhardt
e67af79c4b Delete xref to suidperl(1) which has long since been removed in perl5.12. 2022-08-14 15:43:27 +02:00
Jens Schweikhardt
4ee44ffcca Indicate that kgdb.1 is from ports/devel/gdb. 2022-08-14 15:17:29 +02:00
Jens Schweikhardt
7c20397b72 In man page cross refs to sudo, indicate it comes from ports/security/sudo. 2022-08-14 11:44:43 +02:00
Kirk McKusick
6e821c35d6 Correctness cleanups in fsck_ffs(8).
Allocation or I/O failures in fsck_ffs(8) could cause segment
faults because of missing checks or not-yet-initialized data
structures. Correct these issues.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-08-13 13:28:31 -07:00
Kirk McKusick
e688661642 Move the ability to search for alternate UFS superblocks from fsck_ffs(8)
into ffs_sbsearch() to allow use by other parts of the system.

Historically only fsck_ffs(8), the UFS filesystem checker, had code
to track down and use alternate UFS superblocks. Since fsdb(8) used
much of the fsck_ffs(8) implementation it had some ability to track
down alternate superblocks.

This change extracts the code to track down alternate superblocks
from fsck_ffs(8) and puts it into a new function ffs_sbsearch() in
sys/ufs/ffs/ffs_subr.c. Like ffs_sbget() and ffs_sbput() also found
in ffs_subr.c, these functions can be used directly by the kernel
subsystems. Additionally they are exported to the UFS library,
libufs(8) so that they can be used by user-level programs. The new
functions added to libufs(8) are sbfind(3) that is an alternative
to sbread(3) and sbsearch(3) that is an alternative to sbget(3).
See their manual pages for further details.

The utilities that have been changed to search for superblocks are
dumpfs(8), fsdb(8), ffsinfo(8), and fsck_ffs(8). Also, the prtblknos(8)
tool found in tools/diag/prtblknos searches for superblocks.

The UFS specific mount code uses the superblock search interface
when mounting the root filesystem and when the administrator doing
a mount(8) command specifies the force flag (-f). The standalone UFS
boot code (found in stand/libsa/ufs.c) uses the superblock search
code in the hope of being able to get the system up and running so
that fsck_ffs(8) can be used to get the filesystem cleaned up.

The following utilities have not been changed to search for
superblocks: clri(8), tunefs(8), snapinfo(8), fstyp(8), quot(8),
dump(8), fsirand(8), growfs(8), quotacheck(8), gjournal(8), and
glabel(8). When these utilities fail, they do report the cause of
the failure. The one exception is the tasting code used to try and
figure what a given disk contains. The tasting code will remain
silent so as not to put out a slew of messages as it trying to taste
every new mass storage device that shows up.

Reviewed by: kib
Reviewed by: Warner Losh
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D36053
Sponsored by: The FreeBSD Foundation
2022-08-13 12:43:40 -07:00
Jens Schweikhardt
14e3d3248a Fix wrong capitalization in man page references. 2022-08-13 20:46:59 +02:00
Franco Fichtner
28b64169ea pf: stop resolving hosts as dns that use ":" modifier
When the interface does not exist avoid passing host with special pf
modifiers to DNS resolution as they come up empty anyway.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35429
2022-08-08 18:31:52 +02:00
Kristof Provost
63167eb48c pfctl tests: test case for the POM_STICKYADDRESS fix
In 1e73fbd8b we fixed an issue with POM_STICKYADDRESS being checked in
the wrong struct.
Add a basic test case for this fix.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-08-08 09:30:42 +02:00
Franco Fichtner
1e73fbd8b2 pfctl: fix FOM_ICMP/POM_STICKYADDRESS clash
pass inet proto icmp icmp-type {unreach}
	pass route-to (if0 127.0.0.1/8) sticky-address inet

The wrong struct was being tested. The parser tries to prevent
"sticky-address sticky-address" syntax but was actually cross-rule
enforcing that ICMP filter cannot be before the use of "sticky-address"
in next rule.

MFC after:	2 weeks
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D36050
2022-08-06 14:22:42 +02:00
Kirk McKusick
23c8b19c1d Drop checks with last alternate superblock in fsck_ffs(8).
The fsck_ffs(8) utility made sanity checks of critical superblock
fields by comparing the values of those fields in the standard
superblock againt the values of those fields in the last alternate
superblock. The code for validating a superblock now cover all the
checked fields as well as many more. Further the checks done are
far more comprehensive. So we now drop the alternate superblock
checks as they no longer provide value. Dropping these checks also
eliminates the need to read the alternate superblock.
2022-08-04 16:08:18 -07:00
Kirk McKusick
b21582ee03 Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.

The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.

The two existing options are now flags:

UFS_NOHASHFAIL will note if the check hash is wrong but will still
   return the superblock. This is used by the bootstrap code to
   give the system a chance to come up so that fsck can be run to
   correct the problem.

UFS_NOMSG indicates that superblock inconsistency error messages
   should not be printed. It is used by programs like fsck that
   want to print their own error message and programs like glabel(8)
   that just want to know if a UFS filesystem exists on a partition.

One additional flag is added:

UFS_NOCSUM causes only the superblock itself to be returned, but does
   not read in any auxiliary data structures like the cylinder group
   summary information. It is used by clients like glabel(8) that
   just want to check for possible filesystem types. Using UFS_NOCSUM
   skips the superblock checks for csum data which allows superblocks
   that have corrupted csum data to be read and used.

The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.

Sponsored by: The FreeBSD Foundation
2022-07-30 22:51:38 -07:00
Kirk McKusick
58cb362676 Fix for 90e2971 that caused some geli commands to return the wrong exit status.
The reported problem is that some geli commands exit with a
success status when they should exit with a failed status.

The gctl_error() function is defined differently in the kernel
(in sys/geom/geom_ctl.c) versus in the geom user facilities (in
sbin/geom/misc/subr.c). In the kernel, calling gctl_error() causes
an error return to be set while in the user version it does not.
It was only by a quirk that had been added to the user geom return
processing that I "cleaned up" that the lack of the user implementaion
to set the error return showed up.

This patch adds the missing setting of the error code when calling
the user facility gctl_error().

Reported by:  Jenkins
Debugging by: Alan Somers
Debugging by: Cy Schubert
Debugging by: Li-Wen Hsu
2022-07-29 11:11:46 -07:00
Stefan Eßer
9f3aa538e3 sbin/md5.c: fix -q -c for BSD style versions
The BSD style commands (with names not ending in "sum") ignored the -c
options and the passed digest value when invoked with -q.

The man page stated that -q causes only the calculated digest to be
printed, but did not consider the case of both the -q and -c being
used in combination.

Since there is no warning that -c will be ignored when the -q option
is used, users night (and did) expect that the exit code would reflect
the matching of the calculated digest and the argument passed with -c.

This update implements and documents this expected behavior.

PR:		265461
Reported by:	Dmitrij <bugs.freebsd@1fff.net>
MFC after:	2 weeks
2022-07-26 23:04:57 +02:00
Kirk McKusick
bf24d17fda Have dumpfs(8) ignore superblock check-hash failures.
Set the STDSB_NOHASHFAIL request so that dumpfs(8) can print out
filesystem details even when the superblock checksum is incorrect.
2022-07-24 18:12:24 -07:00
Kirk McKusick
1297a704d9 Output fs_csaddr rather than fs_old_csaddr for UFS1 filesystems.
Since fs_csaddr is what will actually be used, show that value rather
than the historic and possibly incorrect value for UFS1 filesystems.
2022-07-24 18:12:24 -07:00
Kristof Provost
b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
The setvlantag() and setvlanproto() functions are used in two scenarios:
when we create a new vlan interface and when we update an existing
interface.
These are distinguished by the getvlan() at the end of the functions. If
this fails we assume that is because the interface doesn't exist (so
we're creating a new one). We only update the 'params' struct, and
expect the settings to be applied when we vlan_create().

However, if we're updating an existing interface we do not retrieve the
current settings, and can end up invalidating settings.

Fix this by using the settings we retrieved while checking which
scenario we're in.

Note that we do not address this for setvlandev(), because if_vlan does
not allow the vlan parent device to be changed without disassociating it
first (with ifconfig vlanX -vlandev).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35848
2022-07-21 18:36:01 +02:00
Kirk McKusick
f030f1102c Delete UFS2 backup superblock recovery info when building a UFS1 filesystem.
Only the UFS2 filesystem has support for storing information needed
to find alternate superblocks. If that information is inadvertently
left in place when building a UFS1 filesystem, fsck_ffs may stumble
across it and attempt to use it to recover the UFS1 filesystem
which can only end poorly.
2022-07-20 22:52:10 -07:00
Kirk McKusick
7c332e97bb Ask to look for alternate UFS2 superblocks when the standard one is unusable.
This feature was inadvertently lost in commit c0bfa109b9.
2022-07-20 22:52:10 -07:00
Simon J. Gerraty
ab4f0a1518 Add -S option to veriexec
During software installation, use veriexec -S to strictly
enforce certificate validity checks (notBefore, notAfter).

Otherwise ignore certificate validity period.
It is generally unacceptible for the Internet to stop working
just because someone did not upgrade their infrastructure for a decade.

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	sebastien.bini_stormshield.eu
Differential Revision:	https://reviews.freebsd.org/D35758
2022-07-19 08:59:53 -07:00
Mitchell Horne
287d467c5d mac: add new mac_ddb(4) policy
Generally, access to the kernel debugger is considered to be unsafe from
a security perspective since it presents an unrestricted interface to
inspect or modify the system state, including sensitive data such as
signing keys.

However, having some access to debugger functionality on production
systems may be useful in determining the cause of a panic or hang.
Therefore, it is desirable to have an optional policy which allows
limited use of ddb(4) while disabling the functionality which could
reveal system secrets.

This loadable MAC module allows for the use of some ddb(4) commands
while preventing the execution of others. The commands have been broadly
grouped into three categories:
 - Those which are 'safe' and will not emit sensitive data (e.g. trace).
   Generally, these commands are deterministic and don't accept
   arguments.
 - Those which are definitively unsafe (e.g. examine <addr>, search
   <addr> <value>)
 - Commands which may be safe to execute depending on the arguments
   provided (e.g. show thread <addr>).

Safe commands have been flagged as such with the DB_CMD_MEMSAFE flag.

Commands requiring extra validation can provide a function to do so.
For example, 'show thread <addr>' can be used as long as addr can be
checked against the system's list of process structures.

The policy also prevents debugger backends other than ddb(4) from
executing, for example gdb(4).

Reviewed by:	markj, pauamma_gundo.com (manpages)
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35371
2022-07-18 22:06:15 +00:00
Kirk McKusick
90e29718cf Clarify when GEOM utilities exit with success or failure.
Historically, GEOM utilities (gpart(8), gstripe(8), gmirror(8),
etc) used the gctl_error() routine to report errors. If they called
gctl_error() they would exit with EXIT_FAILURE, otherwise they would
return with EXIT_SUCCESS. If they used gctl_error() to output an
informational message, for example when run with the -v (verbose)
option, they would mistakenly exit with EXIT_FAILURE. A further
limitation of the gctl_error() function was that it could only be
called once. Messages from any additional calls to gctl_error()
would be silently discarded.

To resolve these problems a new function, gctl_msg() has been added.
It can be called multiple times to output multiple messages. It
also has an additional errno argument which should be zero if it is
an informational message or an errno value (EINVAL, EBUSY, etc) if
it is an error. When done the gctl_post_messages() function should
be called to indicate that all messages have been posted. If any
of the messages had a non-zero errno, the utility will EXIT_FAILURE.
If only informational messages (with zero errno) were posted, the
utility will EXIT_SUCCESS.

Tested by:   Peter Holm
PR:          265184
MFC after:   1 week
2022-07-16 10:26:51 -07:00
Gordon Bergling
c9856c4ffb pfctl(8): Fix a typo in a source code comment
- s/bufer/buffer/

MFC after:	3 days
2022-07-16 13:48:30 +02:00
Eugene Grosbein
3c9ad9398f ifconfig.8: cleanup reminiscence about long gone ppp(4)
Replace ppp(4) removed since FreeBSD 8.0-RELEASE with vlan(4).
While here, remove commented out reference to non-existing "egress"
interface group hiding since initial import of interface groups
from OpenBSD in 2006.
2022-07-11 11:53:54 +07:00
Zhenlei Huang
7f7a804ae0 vxlan: Add support for socket ioctls SIOC[SG]TUNFIB
Submitted by: Luiz Amaral <email@luiz.eng.br>
PR: 244004
Differential Revision:	https://reviews.freebsd.org/D32820
MFC after:	2 weeks
2022-07-08 18:14:19 +00:00
Cy Schubert
c47db49ba4 ipfilter: Support only jails in VNET
Jails without VNET have complete access to the ipfilter rules, NAT,
pools and logs. This is insecure. Only allow jails to manipulate
ipfilter rules, NAT tables and ippools if the jail has its own VNET.
Otherwise a jail can affect the global system.

This patch brings ipfilter in line with ipfw's support of VNET jails and
non-support of non-VNET jails.

MFC after:	1 week
2022-07-07 07:53:45 -07:00
Rick Macklem
aba7a81ab7 mount_nfs.8: Update BUGS section for NFSv4.1/4.2
If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but there was no specific mention of the session slot
problem.  This patch adds a sentence for this case.

PR: 260011
Reviewed by:	gbe
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35693
2022-07-03 13:37:23 -07:00
Rick Macklem
c0d14b0220 mount_nfs: Warn that intr, soft are not safe for NFSv4
If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but more needs to be done.  This patch adds code that
generates a warning message when the mount is done.

PR: 260011
Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35407
2022-07-01 14:43:17 -07:00
Zhenlei Huang
2567cc419e ifconfig.8: Polish
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35686
2022-07-01 11:00:26 +02:00
Mateusz Piotrowski
0438e9beb5 sysctl.8: Reference sysctl(9)
MFC after:	1 week
2022-06-30 16:22:01 +02:00
Hubert Mazur
b439f64ac1 Improve parameters handling in veriexec
Provide more robust parameter parsing in veriexec. Do a little cleanup as well.

Differential revision:	https://reviews.freebsd.org/D33246
Obtained from:		Semihalf
Reviewed by:		sjg, sebastien.bini_stormshield.eu
2022-06-29 10:57:01 +02:00
Zhenlei Huang
ccc48995c2 ifconfig.8: Prefer consistent terminologies
Reviewed by:	pauamma_gundo.com, email_luiz.eng.br
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35384
2022-06-29 08:57:07 +02:00
Kirk McKusick
2049cc3218 Correctly update fs_dsize in growfs(8)
When growing a UFS/FFS filesystem, the size of the summary information
may expand into additional blocks. These blocks must be removed from
fs_dsize which records the number of blocks in the filesystem that can
be used to hold filesystem data.

While here also update the fs_old_dsize and fs_old_size fields for
compatibility with kernels that were compiled before the addition
of UFS2.

Reported by: Edward Tomasz Napiera
MFC after:   1 week
2022-06-27 21:48:24 -07:00
Kirk McKusick
78dfcf256a Eliminate set but not used variable.
No functional change intended.
2022-06-27 21:48:24 -07:00
Greg V
e6ba4cda73 devmatch: Properly ignore commented fields
Any field that starts with # is a commented out field (there as a place
holder only, the data in that place holder is completely ignored). The
previous code improperly detected this using strcmp. Instead, any field
whose names starts with '#' is ignored.

Differential Reivsion: https://reviews.freebsd.org/D34633
2022-06-27 14:44:23 -06:00
Fernando Apesteguía
4a3c598f35 Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86
2022-06-27 18:20:03 +02:00
Fernando Apesteguía
942e234d86 Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586
2022-06-26 18:53:08 +02:00
Mateusz Piotrowski
78d4bd8753 ifconfig.8: Document -g all and -G all
The special group name "all" selects all the interfaces.

MFC after:	3 days
2022-06-24 11:38:02 +02:00
Eugene Grosbein
95144583f7 adjkerntz(8): revert "detect extra jailed invokation to keep logs clean"
This reverts commit 048ce0876f
due to bugs. Reworked change will be committed later hopefully.
2022-06-23 21:46:08 +07:00
Eugene Grosbein
048ce0876f adjkerntz(8): detect extra jailed invokation to keep logs clean
It may happen that "adjkerntz -a" called from jailed root crontab.
In that case it spams logs with a line:

sysctl(set: "machdep.wall_cmos_clock"): Operation not permitted

Be silent in that case.

MFC after:	1 month
2022-06-22 01:32:54 +07:00
Kristof Provost
1f61367f8d pf: support matching on tags for Ethernet rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35362
2022-06-20 10:16:20 +02:00
Kyle Evans
4014365e42 mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted
as a percent until you slap a decimal on it and magically it becomes an
absolute value.

Let's have a flag day in 14.0 and remove this shim entirely.  Setting with
percent can still be useful, so allow a trailing '%' to indicate as such.
As a side effect, we tighten down the format allowed in the volume a little
bit by ensuring there's no trailing garbage after the value once it's
separated into left and right components.

Reviewed by:	christos, hselasky, pauamma_gundo.com (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35101
2022-06-17 22:50:58 -05:00
Juraj Lutter
ad0a7ea650 kldload: Bring functionality in line with manual page
Honor -q parameter and do not display any warning messages when -q is
specified.

Approved by:		dfr
MFC after:		2 weeks
Sponsored by:		Resulta, s.r.o.
Differential Revision:	https://reviews.freebsd.org/D35511
2022-06-17 16:53:28 +02:00
Andrew Turner
ea578b34cb Remove PAGE_SIZE from hastd
It may not be known at compile time so we should detect it at run time.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35118
2022-06-17 10:36:17 +01:00
Kristof Provost
5575d5a548 dhclient: fix pcp:pcp cleanup failure
If isc-dhcp44-server is not installed (as is the case the project's CI
servers) we don't create ngctl.shutdown, causing the 'rm' to fail.
That in turn causes the cleanup function to return non-zero, which
causes kyua to consider the test failed.

Use 'rm -f' instead, so we don't error even if the file doesn't exist.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-06-17 09:10:52 +02:00
Zhenlei Huang
030f3ee995 ifconfig.8: reflect removal of FDDI and Token Ring
Reviewed By:	pauamma
Differential Revision: https://reviews.freebsd.org/D35409
2022-06-15 18:52:05 +01:00
Doug Ambrisko
ce00b11940 mount: revert the active vnode reporting feature
Revert the computing of active vnode reporting since statfs is used
by a lot of tools.  Only report the vnodes used.

Reported by:	mjg
2022-06-15 07:24:55 -07:00
Mitchell Horne
ec1a13df03 Remove mips-specific Makefiles for /sbin and /usr/sbin
They are no longer needed, but were likely missed simply because they
don't show up in a grep for 'mips'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35475
2022-06-14 10:15:03 -03:00
Doug Ambrisko
6468cd8e0e mount: add vnode usage per file system with mount -v
This avoids the need to drop into the ddb to figure out vnode
usage per file system.  It helps to see if they are or are not
being freed.  Suggestion to report active vnode count was from
kib@

Reviewed by:   	kib
Differential Revision: https://reviews.freebsd.org/D35436
2022-06-13 07:56:38 -07:00
Jens Schweikhardt
5d7c65ff36 Correct a typo in a string literal. 2022-06-07 21:48:59 +02:00
Gordon Bergling
e2dfabb589 nvmecontrol(8): Fix a typo in an error message
- s/insufficent/insufficient/

MFC after:	3 days
2022-06-04 20:30:48 +02:00
Arseny Smalyuk
81cac3906e ipfw: add support radix tables and table lookup for MAC addresses
By analogy with IP address matching, add a way to use ipfw radix
tables for MAC matching. This is implemented using new ipfw table
with mac:radix type. Also there are src-mac and dst-mac lookup
commands added.

Usage example:
  ipfw table 1 create type mac
  ipfw table 1 add 11:22:33:44:55:66/48
  ipfw add skipto tablearg src-mac 'table(1)'
  ipfw add deny src-mac 'table(1, 100)'
  ipfw add deny lookup dst-mac 1

Note: sysctl net.link.ether.ipfw=1 should be set to enable ipfw
filtering on L2.

Reviewed by:	melifaro
Obtained from:	Yandex LLC
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D35103
2022-06-04 19:12:29 +03:00
Rick Macklem
7cab630ba4 mount_nfs: Only create a mounttab file entry is nmount(2) succeeds
mount_nfs creates entries in the mounttab file and umount removes
them.  Entries in the mounttab file ae used by rpc.umntall to
notify the NFS server that NFSv3 entries need to be removed when
they have not been removed by umount.

Without this patch, an enty will be created in the mounttab file,
even if the nmount(2) syscall fails for the mount.  This patch
modifies the code so that the mounttab entry is only created
after nmount(2) succeeds.

This change only affects NFSv3 and only affects how showmount
displays NFSv3 mounts.

MFC after:	2 weeks
2022-05-28 15:48:40 -07:00
Konrad Sewiłło-Jopek
c9a5c48ae8 arp: Implement sticky ARP mode for interfaces.
Provide sticky ARP flag for network interface which marks it as the
"sticky" one similarly to what we have for bridges. Once interface is
marked sticky, any address resolved using the ARP will be saved as a
static one in the ARP table. Such functionality may be used to prevent
ARP spoofing or to decrease latencies in Ethernet networks.

The drawbacks include potential limitations in usage of ARP-based
load-balancers and high-availability solutions such as carp(4).

The implemented option is disabled by default, therefore should not
impact the default behaviour of the networking stack.

Sponsored by:		Conclusive Engineering sp. z o.o.
Reviewed By:		melifaro, pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D35314
MFC after:		2 weeks
2022-05-27 12:41:30 +00:00
John-Mark Gurney
35dc7f8f5d
dhclient: test against a real (ISC) dhcp server
This tests both both normal (untagged), and pcp tagged (VLAN 0)
networks which are now common for fiber ISPs.

Reviewed by: markj, kp
Differential Revision: https://reviews.freebsd.org/D35178
2022-05-25 17:02:38 -07:00
Konstantin Belousov
d72ea9fb3f ifconfig: Use SIOCGIFCAPNV if supported
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
277b9588fd ifconfig: add rxtls and -rxtls commands
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
6ca418e481 ifconfig: add setifcapnv()
which uses SIOCSIFCAPNV to set arbitrary string-named interface
capability.

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
42d5cb0927 ifconfig: add glue for specifying functions taking static string parameter
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:33 +03:00
Konstantin Belousov
7aecd12d9c ifconfig: use c99 designated initializers for DEF_CMD
Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Konstantin Belousov
7541a95a54 ifconfig: some style
wrap several too long lines

Reviewed by:	hselasky, jhb, kp
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-05-24 23:59:32 +03:00
Zhenlei Huang
2670ea8a07 devfs.rules: Do not expose "log" in the default devfs rules.
/etc/rc.d/jail no longer creates /dev/log as a symbolic link since
commit 84b354cb9a.

PR:		228351
Reviewed by:	jamie, mark
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D34563
2022-05-24 09:54:38 -04:00
Jessica Clarke
2986638550 pfctl: fix out-of-bounds access
If pfctl is called with "pfctl -a ''" we read outside of the anchoropt
buffer. Check that the buffer is sufficiently long to avoid that.

Maintain the existing (and desired, because it's used as such in
/etc/periodic/security/520.pfdenied) behaviour of treating "-a ''" as a
request for the root anchor (or no anchor specified).

PR:		264128
Reviewed by:	kp
2022-05-22 10:31:42 +02:00
Mike Karels
a30eee517d ping: add missing test files to Makefile
Should fix ATF tests after 5af718a592.
2022-05-20 22:13:02 -05:00
Mike Karels
5af718a592 ping: if -S srcaddr uses a numeric address, use that protocol
The command "ping -S dotted.quad hostname" fails on dual-stack hosts
with the confusing message "ping: invalid source address: Name does
not resolve" because IPv6 is selected in preference.  If the argument
to -S is numeric (likely), select the corresponding address family,
as if -4 or -6 was specified.  Add tests that either IPv4 or IPv6 can
be forced via a -S parameter.

Reviewed by:	asomers
Differential Revision: https://reviews.freebsd.org/D35271
MFC after:	1 week
2022-05-20 18:30:47 -05:00
Mitchell Horne
6543fa5a5c dumpon: warn if the configured netdump link is down
Previously we expected the DIOCSKERNELDUMP ioctl to return ENXIO if the
interface was down, but it does not actually do this. Grab the link
status using getifaddrs(3) instead, and downgrade this case from an
error to a warning; the user might bring the link back up at a later
time.

Reviewed by:	cem
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35196
2022-05-14 10:27:54 -03:00
Eugene Grosbein
9d7cefc278 ipfw.8: spell "layer2" consistently throughout the manual page
MFC after:	1 week
2022-05-14 04:30:29 +07:00
Kirk McKusick
bf46c0a9ae Clean up comments in fsck.h.
No functional change.
2022-05-10 16:06:15 -07:00
Mark Johnston
f775c417fd newfs_msdos: Fix warnings that arise when compiled for makefs
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-10 17:26:50 -04:00
Warner Losh
2f44ad86f5 dmesg: Better wording from review
I pushed the last changes before I'd noticed the better wording
suggestions in the review. Also include a note that not all lines will
have a timestampe. Some multi-line messages are generated with sbuf, and
when those are pushed, only the first line will have the
timestamp. Document this quirky behavior as well since fixing it likely
won't happen soon. CAM periph drivers generate all the lines in their
announce message together so they aren't intermingled with other things,
for example.

Suggested by:		allanjude, emaste, rpokala
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D35139
Differential Revision:	https://reviews.freebsd.org/D35141
2022-05-07 09:55:40 -06:00
Warner Losh
45ae223ac6 msgbuf: Allow microsecond granularity timestamps
Today, kern.msgbuf_show_timestamp=1 will give 1 second granularity
timestamps on dmesg lines. When kern.msgbuf_show_timestamp=2, we'll
produce microsecond level graunlarity.
For example:
old (== 1):
[13] Dual Console: Video Primary, Serial Secondary
[14] lo0: link state changed to UP
[15] bxe0: NIC Link is Up, 10000 Mbps full duplex, Flow control: ON - receive & transmit
[15] bxe0: link state changed to UP
new (== 2):
[13.807015] Dual Console: Video Primary, Serial Secondary
[14.544150] lo0: link state changed to UP
[15.272044] bxe0: NIC Link is Up, 10000 Mbps full duplex, Flow control: ON - receive & transmit
[15.272052] bxe0: link state changed to UP

Sponsored by:		Netflix
2022-05-07 09:32:22 -06:00
Warner Losh
6910fee62e dmesg: Document kern.msgbuf_show_timestamp
kern.msgbuf_show_timestamp=1 turns on timestamps in kernel's message
buffer which dmesg(8) prints.

Sponsored by:		Netflix
2022-05-07 09:32:21 -06:00
Alexander Leidinger
b29fb6cffd Improve description of the nocache option.
Discussed with:	pstef
2022-05-06 13:03:30 +02:00
Kirk McKusick
262b581d17 Properly specify the level of indirect block being looked up.
The value is used only for diagnostic purposes so no functional
change should result.
2022-05-05 16:58:03 -07:00
Eugene Grosbein
0aef862845 If setkey(8) is used without ipsec.ko loaded beforehand,
its attempt to install SA/SPD into the kernel results in cryptic
EINVAL error code.

Let it be a bit more user-friendly and try to load ipsec.ko
automatically if it is not loaded, just like ifconfig(8) does it
for modules it needs.

PR:		263379
MFC after:	2 weeks
2022-05-05 19:02:29 +07:00
Mina Galić
7ac164dc8e pkgbase: move devd's hyperv.conf to hyperv-tools package
This devd config file is useless without hyperv-tools, so we're moving
it into the hyperv-tools package. pr#263691

PR:		263691
MFC after:	3 days
2022-05-03 18:15:54 +02:00
Enji Cooper
f9f42a709b sbin/devfs: Correct usage
The -s applies to rule keyword only and it follows the rule keyword.

MFC after:	1 week
PR: [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id= 263289|263289]]
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
Fixes: c3e412c083 sbin/devfs: clarify usage
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D34934
2022-04-30 11:00:11 -07:00
Alan Somers
2f6362484c fusefs: use the fsname mount option if set
The daemon can specify fsname=XXX in its mount options.  If so, the file
system should report f_mntfromname as XXX during statfs.  This will show
up in the output of commands like mount and df.

Submitted by:	Ali Abdallah <ali.abdallah@suse.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35090
2022-04-29 11:10:03 -06:00
John Baldwin
e6dede1456 setkey(8): Clarify language around AEAD ciphers.
AEAD ciphers for IPsec combine both encryption and authentication.  As
such, ESP configurations using an AEAD cipher should not use a
seperate authentication algorithm via -A.  However, this was not
apparent from the setkey manpage and 12.x and earlier did not perform
sufficient argument validation permitting users to pair an explicit -A
such as SHA256-HMAC with AES-GCM.  (The result was a non-standard
combination of AES-CTR with the specified MAC, but with the wrong
initial block counter (and thus different keystream) compared to using
AES-CTR as the cipher.)

Attempt to clarify this in the manpage by explicitly calling out AEAD
ciphers (currently only AES-GCM) and noting that AEAD ciphers should
not use -A.

While here, explicitly note which authentication algorithms can be
used with esp vs esp-old.  Also add subsection headings for the
different algorithm lists and tidy some language.

I did not convert the tables to column lists (Bl -column) though that
would probably be more correct than using literal blocks (Bd
-literal).

PR:		263379
Reviewed by:	Pau Amma <pauamma@gundo.com>, markj
Differential Revision:	https://reviews.freebsd.org/D34947
2022-04-27 12:23:18 -07:00
Reid Linnemann
0abcc1d2d3 pf: Add per-rule timestamps for rule and eth_rule
Similar to ipfw rule timestamps, these timestamps internally are
uint32_t snaps of the system time in seconds. The timestamp is CPU local
and updated each time a rule or a state associated with a rule or state
is matched.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34970
2022-04-22 19:53:20 +02:00
Alexander Leidinger
b75644771a Add nullfs specific nocache option. 2022-04-22 10:22:26 +02:00
Kristof Provost
c90f8cb899 pfctl tests: fix Ethernet output expectations
Since a16732d670 we always print the l3 src/destination for Ethernet
rules. Update the tests to account for this.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-21 10:26:00 +02:00
Warner Losh
b91a48693a ifconfig: Fix spelling error
s/discreet/discrete

Reported by: Diane Bruce
2022-04-20 17:57:42 -06:00
Kristof Provost
a16732d670 pfctl: always print 'l3' source/destination
While the kernel only performs the L3 check for
ETHERTYPE_IP/ETHERTYPE_IP6 we should always print the source and
destination addresses.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34918
2022-04-20 13:01:12 +02:00
Kristof Provost
812839e5aa pf: allow the use of tables in ethernet rules
Allow tables to be used for the l3 source/destination matching.
This requires taking the PF_RULES read lock.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34917
2022-04-20 13:01:12 +02:00
Piotr Pawel Stefaniak
d399eb3ef7 ping: split the visual part of -f into a new option -.
After this, we'll be able to ping a host and not spam the terminal, and
no flooding will have to be involved. I've been doing this under Linux
as ping -fi1 host.

Reviewed by:	rpokala, Pau Amma
Differential Revision:	https://reviews.freebsd.org/D34882
2022-04-18 18:10:50 +02:00
Mitchell Horne
0a5c04a892 savecore: add an option to save a live minidump
The new '-L' flag will cause savecore to invoke the new mem(4) kernel
dump ioctl, taking a dump of the running system and writing the result
to a temporary file. Validation of the dump header is performed, similar
to regular crash dumps, and the final result is written to
livecore.X[.zst|.gz].

Also added is the '-Z' flag, which instructs the kernel to compress the
livedump compressed with zstd, akin to the existing -z flag. This option
has no effect in normal savecore(8) operation, but in theory could be
extended to perform such compression while reading the dump from the
dump device.

Encryption is unsupported for live dumps.

For example: 'savecore -Lz /var/crash' would create:
/var/crash/livecore.0.gz

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34347
2022-04-18 12:56:16 -03:00
Mitchell Horne
cf02cf8dbf savecore: factor out info file handling
Move it to a separate function, allowing its reuse.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34822
2022-04-18 12:56:15 -03:00
Mitchell Horne
fafeb5342b savecore: decrease filename buffer sizes
All files are now created relative to savedirfd, e.g. with openat(2).
Therefore, we do not need character buffers to be PATH_MAX bytes long,
just long enough to hold the complete filename. 32 bytes is long enough
in all cases. These can be allocated on the stack.

While here, fix an error message that attempts to use an uninitialized
infoname.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34821
2022-04-18 12:56:15 -03:00
Mitchell Horne
4243d307d3 savecore: fold maxdumps check into getbounds()
So that new callers of getbounds() don't need to duplicate it.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34783
2022-04-18 12:56:15 -03:00
Matteo Riondato
d86cf44350 pfctl: fix recursive printing of rules
When asked to print rules recursively, correctly recurse for anchors
included in pf.conf with "anchorname/*".

PR:		262590
Reviewed by:	kp
MFC after:	3 weeks
2022-04-14 17:25:41 +02:00
Mateusz Piotrowski
632ea8ea98 ifconfig.8: Note that -l accepts -g in addition to -d and -u
Fixes:	5533c5046a ifconfig.8: Update -l synopsis
MFC after:	3 days
2022-04-11 20:05:36 +02:00
Mateusz Guzik
a3214fbe7f mount: use pidfile_signal
This fixes a performance problem where poudriere -j 104 keeps remounting
filesystems, which induce wanting to signal mountd, if running. The
current code tries to do it by creating the pidfile in /var/run and
unlinking it if the operation succeeds, inducing contention against
anything doing an exec as it tries to look up /var/run/ld-elf.so.hints

Differential Revision:	https://reviews.freebsd.org/D34681
2022-04-09 15:59:43 +00:00
Gordon Bergling
299fcf402d fsck_ffs(8): Fix a typo in a source code comment
- s/it it/if it/

MFC after:	3 days
2022-04-09 14:38:00 +02:00
Gordon Bergling
009727ed57 routed(8): Remove a double word in a source code comment
- s/it it/it/

MFC after:	3 days
2022-04-09 14:36:20 +02:00
Gordon Bergling
b95a6ecffa hastd(8): Fix a typo in a source code comment
- s/proccesses/processes/

MFC after:	3 days
2022-04-09 14:06:30 +02:00
Gordon Bergling
efb45ad024 umount(8): Remove a double word in a source code comment
- s/this this/this/

MFC after:	3 days
2022-04-09 10:13:45 +02:00
Gordon Bergling
d7958fe1bc ipnat(5): Fix a double word in the manual page
- s/be be/be/

MFC after:	3 days
2022-04-09 09:28:43 +02:00
Gordon Bergling
a06052d623 dhclient(8): Fix a typo in a source code comment
- s/explicitely/explicitly/

MFC after:	3 days
2022-04-09 09:28:06 +02:00
Mitchell Horne
173fc6f456 savecore: include '-u' flag in usage message
Reported by:	Pau Amma <pauamma@gundo.com>
Fixes		bc7ed46b63 ("Add '-u' switch that would...")
MFC after:	3 days
2022-04-05 16:23:02 -03:00
Reid Linnemann
4823489ab6 libpfctl: relocate implementations of pfr_add/get/set_addrs
Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34740
2022-04-04 19:14:23 +02:00
Kyle Evans
dadb9c7093 bectl: push space-in-name check down into libbe
This check was previously in `create` only, not applying to renames.  It
should really be applied at the libbe level, so that we can avoid
writing about this restriction over and over again.

While we're here: `bectl rename` always succeeds, even when it doesn't.
Start returning the error.

Reported By:	Christian McDonald <cmcdonald netgate com>
Reviewed by:	rew, jwmaag_gmail.com (earlier version)
Differential Revision:	https://reviews.freebsd.org/D34605
2022-04-02 21:04:31 -05:00
Gordon Bergling
8a3568b584 ipf(5): Fix a typo in the manual page
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:50:45 +02:00
Gordon Bergling
e09d161bd9 devd(8): Fix a typo in a configuration file
- s/coresponding/corresponding/

MFC after:	3 days
2022-04-02 11:52:26 +02:00
Mateusz Guzik
c4a08ef2af pf: handle duplicate rules gracefully
Reviewed by:	kp
Reported by:	dch
PR:		262971
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-01 18:01:48 +00:00
Kyle Evans
c0f846ff23 bectl: add some discussion about boot environment layouts
Discuss the standard type of layout, as well as the "deep" BE layout,
and some of the properties of both.  Point the various -r flags at this
new section, to help users understand which they're working with and
what the -r flag is actually doing. Note that we may just deprecate the
-r flag in future versions, but the flag will be recognized as a NOP at
that point.

Reviewed by:	pauamma_gundo.com, rew
Differential Revision:	https://reviews.freebsd.org/D34538
2022-03-31 17:42:33 -05:00
Mateusz Piotrowski
5533c5046a ifconfig.8: Update -l synopsis
The -g flag can be used together with the -l flag.

MFC after:	2 weeks
2022-03-31 17:12:27 +02:00
Mateusz Piotrowski
4d91c53a78 ifconfig.8: Document "ifconfig -g groupname"
"ifconfig -g groupname" prints a list of interface names,
which could be confusing, because it differs from
the behavior of "ifconfig -a -g groupname".

While here, add two examples showing the difference between
"ifconfig -a -g groupname" and "ifconfig -g groupname".

Fixes:	0dad3f0e15 Import interface groups from OpenBSD.
MFC after:	2 weeks
2022-03-31 17:07:15 +02:00
Mateusz Piotrowski
e57f6630d9 ifconfig.8: Remove commented-out Xr eon 5
This reference has been present in the manual page since the initial
import of BSD 4.4 Lite sbin Sources. It's time for it to be removed.

MFC after:	2 weeks
2022-03-31 12:07:18 +02:00
Mateusz Piotrowski
1969cc7bdc ifconfig.8: Remove remaining Xerox Network Systems(tm) bits
Support for Xeros Network Systems seems to be long gone. There is no
reason to keep this in the manual page.

MFC after:	2 weeks
2022-03-31 12:00:42 +02:00
Mateusz Piotrowski
19ac0bc5c1 ifconfig.8: Simplify examples by using canonical parameters
Also, use Bd instead of Dl for multi line examples.

MFC after:	2 weeks
2022-03-31 11:54:06 +02:00
Mateusz Piotrowski
2cd28d6f9b ifconfig.8: Mark address_family as optional in synopsis
Commands like "ifconfig wlan0 up" are valid. There is no need to always
specify the address family.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
3049aac91b ifconfig.8: Improve description of the address argument
- Split paragraphs for clarity.
- Add an example of setting a random MAC address.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
ad8cac1229 ifconfig.8: Improve readability of address_family documentation
Also, move the description of the special case of "ifconfig -l ether" to
the description of the -l flag.

MFC after:	2 weeks
2022-03-31 11:43:17 +02:00
Jose Luis Duran
607eed2f84 ifconfig.8: Fix quoting
Obtained from:	67d77afb0d (r69907135)
Fixes:		67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 17:43:13 +02:00
Mateusz Piotrowski
388c12e3f4 ifconfig.8: Clean up markup of "state" parameter
MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
39da6db9bc ifconfig.8: Make the -f flag description compact
- Remove extraneous examples
- Apply "-compact" to the list macros so that it is possible to fit the
  definitions of the types and formats in one terminal screen.

MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
ce03846373 ifconfig.8: Clean up the channel parameter description
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
0e2045b294 ifconfig.8: Add section headers to the parameters section
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
186a372f24 ifconfig.8: Clean up -n documentation
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
9076f99b9b ifconfig.8: Clean up -k documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
59cdaadcf6 ifconfig.8: Clean up -C and -v documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
fe1e3b55f2 ifconfig.8: Clean up -l documentation
MFC after: 2 weeks
2022-03-30 14:58:35 +02:00
Mateusz Piotrowski
787599088b ifconfig.8: Clean up -G & -g documentation
MFC after:	2 weeks
2022-03-30 14:58:35 +02:00