Commit graph

9648 commits

Author SHA1 Message Date
Emmanuel Vadot e6a32ddf3f pkgbase: Add nfsiod to the FreeBSD-nfs package
Missed in 081fb64492

(cherry picked from commit e06b8f1128)
2021-08-16 18:15:47 +02:00
Gordon Bergling 71a74e2168 ipfw(8): Fix a typo in an error message
- s/suport/support/

(cherry picked from commit 809ad8170a)
2021-08-16 07:20:31 +02:00
Gordon Bergling bb15117761 iscontrol(8): Fix a typo in a struct
- s/suport/support/

(cherry picked from commit 1e1fbf3b47)
2021-08-16 07:20:00 +02:00
Roy Marples f452713408 socket: Implement SO_RERROR
SO_RERROR indicates that receive buffer overflows should be handled as
errors. Historically receive buffer overflows have been ignored and
programs could not tell if they missed messages or messages had been
truncated because of overflows. Since programs historically do not
expect to get receive overflow errors, this behavior is not the
default.

This is really really important for programs that use route(4) to keep
in sync with the system. If we loose a message then we need to reload
the full system state, otherwise the behaviour from that point is
undefined and can lead to chasing bogus bug reports.

Reviewed by:	philip (network), kbowling (transport), gbe (manpages)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26652

(cherry picked from commit 7045b1603b)
2021-08-10 18:54:00 -07:00
Rick Macklem 46b4c26b5b mount_nfs.8: Add information for "nconnect" to man page
Commit 1e0a518d65 added a new NFS mount option "nconnect".
This patch adds information on this option to the man page.

It also adds an IMPLEMENTATION section that explains how
the default I/O size is determined and that "nfsstat -m" can
be used to find out what option settings are actually in use.

This is a content change.

(cherry picked from commit 4488c8c34b)
2021-08-03 16:49:28 -07:00
Luiz Otavio O Souza 50ecd99be5 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263

(cherry picked from commit 1e7fe2fbb9)
2021-08-02 16:50:32 +02:00
Kristof Provost 70d4a7a966 pf: match keyword support
Support the 'match' keyword.
Note that support is limited to adding queuing information, so without
ALTQ support in the kernel setting match rules is pointless.

For the avoidance of doubt: this is NOT full support for the match
keyword as found in OpenBSD's pf. That could potentially be built on top
of this, but this commit is NOT that.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31115

(cherry picked from commit ef950daa35)
2021-07-31 10:12:02 +02:00
Alan Somers 1b58943ef8 [skip ci] correct a few SPDX license tags
These were all incorrectly labeled as 2-clause BSD licenses by a
semi-automated process, when in fact they are 3-clause.

Discussed with:	pfg, imp
Sponsored by:	Axcient

(cherry picked from commit 3874c0abb0)
2021-07-27 11:57:17 -06:00
Kristof Provost 720b82f821 pfctl: syncookie configuration
pfctl and libpfctl code required to enable/disable the syncookie
feature.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31140

(cherry picked from commit c69121c473)
2021-07-27 09:43:52 +02:00
Warner Losh 5b194853b9 devd: remove pccard entries
The pccard entries are now obsolete, remove them.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31184

(cherry picked from commit a535413556)
2021-07-21 10:13:12 -06:00
Julien Grall 7ca3061f84 etc/ttys: add xen console
Xen VMs get a simulated serial device meant for use as a console.  Often
an xterm or other advanced terminal is used, so use xterm as the type.

Depending on configuration, FreeBSD on Xen for amd64 may instead use an
emulated serial port, but the virtual console may also be available.

Submitted by:	Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by:	imp (slightly earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29873

(cherry picked from commit 2b2c460d7b)
2021-07-21 13:07:34 -03:00
Elliott Mitchell ddefb003ee etc/ttys: merge ttys file down to single file
The tty lists were already pretty similar and there hadn't been any real
need for them to remain distinct for some time. As such, merge to a
single file.

The RISC-V console is preserved. For systems where it doesn't exist, its
presence in /etc/ttys is harmless. The uncommented version of the
ttyv8/XDM line from ttys.amd64 was the one chosen.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30256

(cherry picked from commit c76616f496)
2021-07-21 13:05:01 -03:00
Warner Losh ad0c23cdcd ttys: diff reduction
Back in the day, we used to have a number of entries that were either
'on' or 'off' directly, rather than conditionally on 'onifexists'
etc. Back then, we tried to line up the 'secure' columns by using the
construct 'on secure' or 'off secure' (one space or two). Now that these
have all moved to a conditional construct, remove the second space on
the ttys that still have it. This reduces diffs between the different
ttys and is no functional change. i386 and amd64 did this a long time
ago, and those are the only ones that affected external users (who used
to sed 's/on /off /' the entires as part of the automation).

MFC After:		3 days
Sponsored by:		Netflix

(cherry picked from commit 36be84b966)
2021-07-21 13:04:43 -03:00
Alexander Motin 7de125a406 Partially revert previous commit.
ns identify does not allow nsid of 0xffffffff.  Only general identify
allows it.

MFC after:	1 week

(cherry picked from commit d1a0eab9fb)
2021-07-20 21:56:36 -04:00
Alexander Motin d92453e8b0 For ns identify/delete allow nsid of 0xffffffff.
The first should report common parameters, the second should delete
all namespaces.

MFC after:	1 week

(cherry picked from commit dbf1dce8d6)
2021-07-20 21:56:36 -04:00
Alexander Motin 0b1b2d6882 Filter out LBA formats with LBA Data Size of 0.
According to the spec: "If the value reported is 0h, then LBA format
is not supported / used or is not currently available".

MFC after:	1 week

(cherry picked from commit d379886a41)
2021-07-20 21:54:38 -04:00
Robert Wing fb2feceac3 fsck_ffs: fix background fsck in preen mode
Background checks are only allowed for mounted filesystems - don't try
to open the device for writing when performing a background check.

While here, remove a debugging printf that's commented out.

PR:             256746
Fixes:          5cc52631b3
Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D30880

(cherry picked from commit 0c5a59252c)
2021-07-19 10:06:53 -08:00
Bjoern A. Zeeb 05490438f2 ifconfig: 80211, add line break after key info
Beauty correction for verbose mode or in case we print multiple key
information to not continue with the next options directly after
as we did so far, e.g.:
	AES-CCM 2:128-bit
	AES-CCM 3:128-bit powersavemode ...

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

(cherry picked from commit 5ba4c8de15)
2021-07-18 00:34:57 +00:00
Edward Tomasz Napierala 5a604e56d4 nvmecontrol: fix typo (s/Managment/Management/)
Reported By:	pstef

(cherry picked from commit 95a74ab4fb)
2021-07-12 14:37:07 -06:00
Warner Losh 99ff43c0c7 nvmecontrol: update copyright on passthru command
I wrote this code, not Intel, so put my copyright on this. I mistakenly
copied it for the initial commit.

Sponsored by:		Netflix

(cherry picked from commit 6d6cca3633)
2021-07-12 14:37:07 -06:00
Warner Losh d2299b7159 nvmecontrol: Report status from passthru commands
Report status from dword0 for passthru commands. Many commands report
some status or information here, so reporting it can help know what's
going on.

Sponsored by:		Netflix

(cherry picked from commit 510a3da147)
2021-07-12 14:37:07 -06:00
Warner Losh 39d7a1f479 nvmecontrol: document power command
The description of the power command is missing. While the synopsis is
present, there's no explanation. Add one.

Reviewed by:		mav, chuck
PR:			237866
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31122

(cherry picked from commit 445b5554bf)
2021-07-12 13:42:59 -06:00
Rick Macklem 50f2705d26 mount_nfs.8: Update the man page for commit a145cf3f73
The NFSv4 client now uses the highest minor version of NFSv4
by default instead of minor version 0, for NFSv4 mounts.
The "minorversion" mount option may be used to override this default.

This patch updates the man page to reflect this change.  While here,
fix nfsstat(8) to be nfsstat(1).

(cherry picked from commit b413b03597)
2021-07-11 15:30:01 -07:00
Stefan Eßer 185dcb1072 md5: Improve compatibility with coreutils and format fix
The previous changes that added support for the coreutils -c option
modified the output generated by passing -r to match that of the
coreutils versions. The difference is that coreutils separates the
hash from the file name by two blanks "  " (or a blank followed by
an asterisk " *" with the -b option denoting).

While most scripts or users will not notice the difference, it might
be considered a violation of POLA and this commit reverts the change
for the non-sum programs. These will print a single blank " " as the
separator, as they die before the previous commit.

In order to still generate output that is identical to that of the
coreutils programs, this commit generates the "  " or " *" separator
used by them for the -sum versions, depending on the presence of the
-b option.

(cherry picked from commit b33d1898c1)
2021-07-06 16:56:06 +02:00
Mateusz Guzik d5fe617b09 pfctl: cache getprotobynumber results
As for example pfctl -ss keeps calling it, it saves a lot of overhead
from elided parsing of /etc/nsswitch.conf and /etc/protocols.

Sample result when running a pre-nvlist binary with nfs root and dumping
7 mln states:
before: 24.817u 62.993s 1:28.52 99.1%
after:	8.064u 1.117s 0:18.87 48.5%

Idea by Jim Thompson

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 858937bea4)
2021-07-05 11:32:14 +00:00
Mark Johnston 2d4eba7f8e mdconfig tests: Correct a copy-pasted test description
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4420bb6a86)
2021-06-30 08:18:00 -04:00
Jessica Clarke a4f9c6a9e6 md5: Fix cross-build after c2870e576b
On macOS and Linux the current set of headers do not end up pulling in
sys/param.h, causing MAXPATHLEN to not be defined and the build to fail.

(cherry picked from commit cab31e0e21)
2021-06-28 18:14:02 +02:00
Stefan Eßer 4048460078 sbin/md5: improve compatibility with coreutils -c option
The -c option expects a digest file in either BSD or coreutils format.

The output for matched and mismatched files is identical to that
of the coreutils version.

The review of these changes included test cases that have already
been committed for the functionality that existed before.
Another test script is added to cover the coreutils compatible
extension implemented by this patch.

This commit contains a tests/Makefile that has been cleaned up
compared to the review version, using an implicit rule to apply the
TESTBASE path at build time (and the scripts have been renamed to
have an extension of .SH instead of .sh to trigger this rule).

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D30812

(cherry picked from commit 84f35b6f86)
(cherry picked from commit c2870e576b)
2021-06-28 18:13:09 +02:00
Warner Losh 9ecf4bd8e9 md5: portability fix -- include stdbool.h explicitly
stdbool.h needs to be included to use type bool variables. Due to
namespace pollution, this gets brought in on FreeBSD, but not on
other systems. Include it explicilty.

Noticed by:		arichards@
Sponsored by:		Netflix

(cherry picked from commit d0ea5e467f)
2021-06-28 18:03:38 +02:00
Warner Losh c0d5665be0 md5: Create md5sum, etc compatible programs
On Linux, there's a similar set of programs to ours, but that end in the
letters 'sum'. These act basically like FreeBSD versions run with the -r
option. Add code so that when the program ends in 'sum' you get the
linux -r behavior. This is enough to make most things that use sha*sum
work correctly (the -c / --check options, as well as the long args are
not implemented). When running with the -sum programs, ignore -t instead
of running internal speed tests and make -c an error.

Reviewed by:		sef, and kp and allanjude (earlier version)
Relnotes:		yes
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30309

(cherry picked from commit 086feed850)
2021-06-28 18:03:38 +02:00
Stefan Eßer cb6ebbaa48 sbin/md5: add tests
While the correctness of the supported hash algorithms can be tested
with the built-in self-test feature, these test cases are meant to
detect changes in the output format.

A follow-up commit will	improve	the compatibility with the coreutils
versions of the hash programs, and these tests should detect any
unintended side-effects	of such	a change on existing functionality.

(cherry picked from commit 884fc5527a)

sbin/md5: Create /usr/tests/sbin/md5 directory for placing tests

(Fix by lwhsu (Li-Wen Hsu) to un-break "make distribute".)

(cherry picked from commit cb194afef5)

sbin/md5: fix test case to not write outside temp directory

The bsd-p-test did create files 1.out .. 8.out in the test directory.
This has been fixed and the temporary output files are now written
to the temporary directory.

(cherry picked from commit 95d3044bbd)

Sponsored by:	The FreeBSD Foundation (commit cb194afef5 only)
2021-06-28 11:05:30 +02:00
Lutz Donnerhacke ef84d16e68 ipfw.8: synopsis misses nat show form
Document the existing behavior, which is currently only available by
reading third party documentation or the source code itself.

PR:		254617
Submitted by:	Oliver Kiddle
Differential Revision: https://reviews.freebsd.org/D30189

(cherry picked from commit c8250c5ada)
2021-06-18 11:53:26 +02:00
Robert Wing 01cf73198d bectl(8): don't allow creation of boot environments with spaces
Boot environment datasets that contain spaces are not bootable.

When a user attempts to create a boot environment with a space, abort
the creation and print an error message.

PR:             254441
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D30194

(cherry picked from commit 0e6549c874)
2021-06-11 09:28:41 -08:00
Robert Wing 47ec64b3e8 fsck_ufs: fix segfault with gjournal
The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while
attempting to traverse the buffer cache. The tail queue used for the
buffer cache was not initialized before dropping into gjournal_check().

Initialize the buffer cache before calling gjournal_check().

PR:             245907
Reviewed by:    jhb, mckusick
Differential Revision:  https://reviews.freebsd.org/D30537

(cherry picked from commit 441e69e419)
2021-06-11 08:56:00 -08:00
Robert Wing 157a960058 fsck_ffs(8): fix divide by zero when debug messages are enabled
Only print buffer cache debug message when a cache lookup has been done.

When running `fsck_ffs -d` on a gjournal'ed filesystem, it's possible
that totalreads is greater than zero when no cache lookup has been
done - causing a divide by zero. This commit fixes the following error:

    Floating point exception (core dumped)

Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D30370

(cherry picked from commit 20123b25ee)
2021-06-11 08:44:29 -08:00
Kirk McKusick 02966cbdf0 Fix fsck_ufs segfault when it needs to rerun.
Sponsored by: Netflix

(cherry picked from commit 5c9e9eb7a2)
2021-06-02 12:41:38 -07:00
Konstantin Belousov 4f2efb2ff4 ldconfig(8): update manpage to reality
(cherry picked from commit a19e14ca2d)
2021-05-28 15:04:52 +03:00
Kristof Provost 2f0a807948 pfctl tests: Test fairq configuration
We used to have a bug where pfctl could crash setting fairq queues. Test
this case and ensure it does not crash pfctl.

Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30348

(cherry picked from commit 9938fcaa65)
2021-05-27 09:10:53 +02:00
Kristof Provost a4ceb1e192 pfctl: Fix crash on ALTQ configuration
The following config could crash pfctl:
	altq on igb0 fairq bandwidth 1Gb queue { qLink }
	queue qLink fairq(default)

That happens because when we're parsing the parent queue (on igb0) it
doesn't have a parent, and the check in eval_pfqueue_fairq() checks
pa->parent rather than parent.

This was changed in eval_pfqueue_hfsc() in
1d34c9dac8, but not for fairq.

Reviewed by:	pkelsey
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30346

(cherry picked from commit 26705a39e5)
2021-05-27 09:09:55 +02:00
Kristof Provost 48d771e579 pf: Track the original kif for floating states
Track (and display) the interface that created a state, even if it's a
floating state (and thus uses virtual interface 'all').

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30245

(cherry picked from commit d0fdf2b28f)
2021-05-27 09:06:14 +02:00
Kristof Provost 59f8fc3fbf pfctl: Use DIOCGETSTATESNV
Migrate to using the new nvlist-based DIOCGETSTATESNV call to obtain the
states list.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30244

(cherry picked from commit bc94129147)
2021-05-27 09:06:00 +02:00
Kristof Provost 47a3d57efd pfctl: Ensure parent queue is configured for FAIRQ
We failed to account for the FAIRQ scheduler in expand_altq(), which led
it to be set up without its parent queue.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30347

(cherry picked from commit dc78428796)
2021-05-27 09:03:42 +02:00
Lutz Donnerhacke 72fe4684e0 ipfw.8: Fix table example
Fix some erronous lines in the example section.

PR:		248943
Submitted by:	Jose Luis Duran
Reviewers:	ae, manpages (gbe)
Differential Revision: https://reviews.freebsd.org/D30191

(cherry picked from commit 802637be06)
2021-05-25 07:41:37 +02:00
Kirk McKusick e198c1dc8f Fix fsck_ffs Pass 1b error exit "bad inode number 256 to nextinode".
(cherry picked from commit fe815b88b5)

PR:           255979
Sponsored by: Netflix
2021-05-22 14:03:37 -07:00
Kirk McKusick c910e015ba Correct assert added to dump program.
(cherry picked from commit efe145a745)
2021-05-20 15:57:37 -07:00
Kirk McKusick e2a49768a4 Ensure that files with no allocated blocks are trimmed to zero length.
(cherry picked from commit a3628327e7)
2021-05-18 13:26:00 -07:00
Lutz Donnerhacke 7200fdb9da sbin/ipfw: Fix parsing error in table based forward
The argument parser does not recognise the optional port for an
"tablearg" argument.  Fix simplifies the code by make the internal
representation expicit for the parser.  Includes the fix from D30208.

PR:		252744
Reported by:	<bugs.freebsd.org@mx.zzux.com>
Approved by:	nc
Tested by:	<bugs.freebsd.org@mx.zzux.com>
Differential Revision: https://reviews.freebsd.org/D30164

(cherry picked from commit 6cb13813ca)
(cherry picked from commit f6f297871d)
2021-05-18 08:10:00 +02:00
Kirk McKusick 2e762b0252 Clean up fsck_ffs error message output.
(cherry picked from commit 689724cb23)

Sponsored by: Netflix
2021-05-16 17:41:11 -07:00
Kirk McKusick 501b4fb50e Make fsck_ffs more persistent in creating a lost+found directory.
(cherry picked from commit 84a0e3f957)

Sponsored by: Netflix
2021-05-16 17:18:31 -07:00
Kristof Provost 8c610ccac6 pf: Support killing 'matching' states
Optionally also kill states that match (i.e. are the NATed state or
opposite direction state entry for) the state we're killing.

See also https://redmine.pfsense.org/issues/8555

Submitted by:	Steven Brown
Reviewed by:	bcr (man page)
Obtained from:	https://github.com/pfsense/FreeBSD-src/pull/11/
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30092

(cherry picked from commit 93abcf17e6)
2021-05-14 10:42:07 +02:00