Commit Graph

9752 Commits

Author SHA1 Message Date
Gordon Bergling
9afada88e0 ipf(5): Fix a typo in the manual page
- s/accomodate/accommodate/

Approved by:	re@ (gjb)

(cherry picked from commit 8a3568b584)
2022-04-15 15:26:50 +02:00
Kyle Evans
568f805c83 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.

Approved by:	re (gjb)
Reported By:	Christian McDonald <cmcdonald netgate com>

(cherry picked from commit dadb9c7093)
(cherry picked from commit 227e52a9c0)
2022-04-06 09:32:51 -05:00
Kyle Evans
41e0b07a5e 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.

Approved by:	re (gjb)

(cherry picked from commit c0f846ff23)
(cherry picked from commit 0e90da6549)
2022-04-06 09:32:48 -05:00
Warner Losh
abda5677f2 devd: Add rtw to wireless list
rtw88 and rtw89 are coming soon, so add them here now

Approved by:		re@ (gjb)
Sponsored by:		Netflix
MFC After:		1 day

(cherry picked from commit dea368bc5e)
(cherry picked from commit cba6eb5d31)
2022-03-29 17:54:19 -06:00
Warner Losh
a5ece99d22 devd: correct wifi regexp
Correct the wifi regexp to include iwlwifi and remove wi driver that was
has been retired.

Approved by:		re@ (gjb)
Sponsored by:		Netflix

(cherry picked from commit e0ab0ff104)
(cherry picked from commit eeec49e0b3)
2022-03-29 17:54:16 -06:00
Warner Losh
713595ca49 devd: remove the scsi regexp
We don't really use the scsi regexp for anything. The rescan was a
workaround that was fixed a long time ago and has been disabled for
ages. And the regexp was incomplete.

Approved by:		re@ (gjb)
Sponsored by:		Netflix

(cherry picked from commit 926e825ef8)
(cherry picked from commit cb95daaa91)
2022-03-29 17:54:00 -06:00
Alexander V. Chernikov
ce24fa9b49 ifconfig: remove debug printf introduced in 779fd05344
Reported by:	jhb
Approved by:    re(gjb)

(cherry picked from commit 656f5031c3)
(cherry picked from commit b5b97a95aa)
2022-03-28 15:25:27 +00:00
Alexander V. Chernikov
2eb4ac1e6f ifconfig: improve vlan options parsing
PR:	261136
Reported by:	Daniel O'Connor
Approved by:    re(gjb)
MFC after:	2 weeks

(cherry picked from commit 779fd05344)
(cherry picked from commit 157bf2c996)
2022-03-28 15:25:23 +00:00
Wuyang Chung
a14408a531 newfs(8): Fix a bug in initialization of sblock.fs_maxbsize .
Fixes:		1c85e6a35d (SVN r98542)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/587
Sponsored by:	NVIDIA Networking
Approved by:	re (gjb)

(cherry picked from commit c5f549c1e0)
(cherry picked from commit 4391c305e8)
2022-03-17 13:26:14 +01:00
Kirk McKusick
47b50c2318 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.
PR:          262580
Approved by: re (gjb, early MFC)

(cherry picked from commit 2983ec0a87)
(cherry picked from commit 934ba51bc9)
2022-03-16 16:14:57 -07:00
Warner Losh
8f5c107656 camcontrol fwdownload minor improvements
Minor improvements to the fwdownload code suggested by chs@:
o Print the path_id/target we're rescanning so it's not invisible
o No need for XPT_GDEVLIST, all the info is filled in. Remove sending it
  as well as a comment related to it from a mistaken observation. libcam
  always fills these in properly, so use those for the ccb path/target.
o Don't leak /dev/xpt fd in success cases.
o Rename fw_rescan_lun to fw_rescan_target and pass sim_mode to
  only print path_id and target_id info.

Reviewed by:		chs@
Fixes:			9835900cb9
Sponsored by:		Netflix
MFC After:		1 week
Differential Revision:	https://reviews.freebsd.org/D34348

(cherry picked from commit 78fbaa1fac)
2022-03-09 13:52:23 -07:00
Warner Losh
327da43602 camcontrol: Force a rescan of the lun after firmware download.
After downloading the firmware to a device, it's inquiry data likely
will change. Force a rescan of the target with the CAM_EXPECT_INQ_CHANGE
flag to get it to record the new inqury data as being expected. This
avoids the need for a 'camcontrol rescan' on the device which detaches
and re-attaches the disk (da, ada) device. This brings fwdownload up to
nvmecontrol's ability to do the same thing w/o changing the exposed
nvme/nvd/nda device. We scan the target and not the LUN because dual
actuator drives have multiple LUNs, but the firmware is global across
many vendors' drives (and the so far theoretical ones that aren't won't
be harmed by the rescan).

Since the underlying struct disk is now preserved accross this
operation, it's now possible to upgrade firmware of a root device w/o
crashing the system.  On systems that are quite busy, the worst that
happens is that certain operaions are reported cancelled when the new
firmware is activated. These operations are retried with the normal CAM
recovery mechanisms and will work on the retry. The only visible hiccup
is the time that new firmware is flashing / initializing. One should not
consider this operation completely risk free, however, since not all
drives are well behaved after a firmware download.

MFC After:		1 week
Relnotes:		yes
Sponsored by:		Netflix
Feedback by:		mav
Differential Revision:	https://reviews.freebsd.org/D34325

(cherry picked from commit 9835900cb9)
2022-03-09 13:52:22 -07:00
Cy Schubert
d1f3afc4a4 ipfilter: Print protocol when listing NAT table mappings
NAT table mappings list only the source and destination IP, the source
and destinaion port numbers, and their mappings. But the protocol is not
listed. Now that Facebook and Google use QUIC, seeing port 443 in in a
list of active NAT sessions could mean 443/tcp or 443/udp. This patch
adds the protocol to the listing to aid in determining whether HTTPS is
TCP or QUIC in a NAT mapping listing. This also helps differentiatinete
between other protocols such as ICMP, ESP, and AH in ipnat list of active
sessions.

(cherry picked from commit 9291d079d5)
2022-03-07 05:32:58 -08:00
Franco Fichtner
586827df60 dhclient: support VID 0 (no vlan) decapsulation
VLAN ID 0 is supposed to be interpreted as having no VLAN with a bit of
priority on the side, but the kernel is not able to decapsulate this on
the fly so dhclient needs to take care of it.

Reviewed by:	markj

(cherry picked from commit abf5bff71d)
2022-03-07 08:18:57 -05:00
Eric van Gyzen
c14635226b newfs_msdos: connect the ATF test from NetBSD
NetBSD has an ATF test for newfs_msdos.  Connect it to the build.
Adapt it for FreeBSD.  This would have caught the bug fixed by my
previous commit.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116

(cherry picked from commit 4e71258227)
2022-03-02 15:56:30 -06:00
Chuck Silvers
a0c3799828 fsck_ffs: don't try to write in read-only mode
(cherry picked from commit ed1a156b03)

Sponsored by:	Netflix
2022-02-27 21:36:06 -08:00
Chuck Tuffli
7de3a3e919 nvme: fix spelling of Namespace
Fix spelling of a macro definition.

PR:		262141

(cherry picked from commit c2318cf80a)
2022-02-27 17:59:31 -08:00
Kirk McKusick
5f3cd10138 Update fsdb(8) to reflect new structure of fsck_ffs(8).
(cherry picked from commit c5d476c98c)
2022-02-26 13:38:48 -08:00
Kirk McKusick
5628a09019 Avoid unaligned writes by fsck_ffs(8).
(cherry picked from commit 7a1c1f6a03)
2022-02-26 13:34:11 -08:00
Robert Wing
0add00229d dumpfs(8): add option to only print superblock information
Add an option to dumpfs, `-s`, that only prints the super block information.

Reviewed by:	chs, imp
Differential Revision:	https://reviews.freebsd.org/D30881

(cherry picked from commit dc35484536)
2022-02-23 09:27:27 -09:00
Kristof Provost
63220460d0 libpfctl: fix creatorid endianness
We provide the hostid (which is the state creatorid) to the kernel as a
big endian number (see pfctl/pfctl.c pfctl_set_hostid()), so convert it
back to system endianness when we get it from the kernel.

This avoids a confusing mismatch between the value the user configures
and the value displayed in the state.

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

(cherry picked from commit 735748f30a)
2022-02-18 11:14:58 +01:00
Kristof Provost
b5f6f687a2 pfctl: improve error reporting for routehost
If an invalid (i.e. overly long) interface name is specified error out
immediately, rather than in expand_rule() so we point at the incorrect
line.

PR:		260958
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D34008

(cherry picked from commit e68de66943)
2022-02-18 11:14:58 +01:00
Edward Tomasz Napierala
b993d60f60 Cross-reference camcontrol(8) and zonectl(8) man pages.
(cherry picked from commit 28b475b018)
2022-02-14 00:04:44 +00:00
Alan Somers
2af3758a32 Various fixes for ggatec and ggated
Dynamically size buffers in ggatec. Instead of static size on the stack.
Add flush support.

Submitted by:	Johannes Totz <jo@bruelltuete.com>
Reviewed by:	asomers
Differential Revision: https://reviews.freebsd.org/D31722

(cherry picked from commit 6226477a46)

geom_gate: ensure readprov is null-terminated

With crafted input to the G_GATE_CMD_CREATE ioctl, geom_gate can be made
to print kernel memory to the system console, potentially revealing
sensitive data from whatever was previously in that memory page.

But but but: this is a case of the sys admin misconfiguring, and you'd
need root privileges to do this.

Submitted By:	Johannes Totz <jo@bruelltuete.com>
Reviewed By:	asomers
Differential Revision: https://reviews.freebsd.org/D31727

(cherry picked from commit f284bed200)
2022-02-16 21:07:15 -07:00
Kirk McKusick
166926a3de Have fsck_ffs(8) properly correct superblock check-hash failures.
cherry pick cleanups from commit c0bfa109b9

PR:           245916
2022-02-15 17:14:22 -08:00
Kirk McKusick
efd949aaba Have fsck_ffs(8) properly correct superblock check-hash failures.
(cherry picked from commit c0bfa109b9)

PR:           245916
2022-02-15 17:14:22 -08:00
Cy Schubert
d0695f8a40 ipfilter: Restore ipfsync
ipfsync is a WIP sync daemon designed to be used in a failover scenario.
It was removed by 5ee61c7daa. This commit
restores its three files. ipfsync is in my work queue.

(cherry picked from commit 08ab34a06a)
2022-02-07 05:51:18 -08:00
Cy Schubert
52f62a6983 ipfilter: Fix manpage typos
Reported by:	jrtc27
Fixes:		2582ae5740

(cherry picked from commit ad07e93fe1)
2022-02-07 05:51:17 -08:00
Cy Schubert
f4d126ee1f ipfilter userland: Fix typos
Reported by:	netchild
Fixes:		2582ae5740

(cherry picked from commit cc3e5b372e)
2022-02-07 05:51:17 -08:00
Cy Schubert
189b9222f9 ipfilter userland: Fix branch mismerge
The work to ANSIfy and adjust returns to style(9) resulted in a mismerge
of a stash when ipfilter was moved from contrib to sbin. An older file
replaced WIP at the time, resulting in a regression.

The majority of this work was done in 2018 saved as git stashes within
a git-svn tree and migrated to the git tree. The regression occurred
when the various stashes were sequentially merged to create individual
commits, following the ipfilter move to netpfil and sbin.

Reported by:	jrtc27
Fixes:		2582ae5740
Pointy hat to:	cy

(cherry picked from commit a3522837b0)
2022-02-07 05:51:17 -08:00
Cy Schubert
fcb8e92558 ipfilter userland: Style(9) requires a space after return
Reported by:    jrtc27
Fixes:          2582ae5740

(cherry picked from commit 44bc301921)
2022-02-07 05:51:17 -08:00
Cy Schubert
d47287c437 ipfilter: Fix typos
Reported by:	jrtc27
Fixes:		2582ae5740

(cherry picked from commit d86f022e79)
2022-02-07 05:51:16 -08:00
Cy Schubert
7d98606953 ipfilter userland: Fix whitespace errors
Replace leading spaces with a tabs on affected lines.

(cherry picked from commit 5e13b104a4)
2022-02-07 05:51:16 -08:00
Cy Schubert
fa66e74d3b ipfilter userland: Remove trailing whitespace
(cherry picked from commit 27fc223414)
2022-02-07 05:51:16 -08:00
Cy Schubert
9787fb28c9 ipfilter: Adjust userland returns to conform to style(9)
Adjust ipfilter's userland return statements to conform to style(9).

(cherry picked from commit 2582ae5740)
2022-02-07 05:51:15 -08:00
Cy Schubert
c95ef272f1 ipfilter: INLINE --> inline
Replace the INLINE macro with inline. Some ancient compilers supported
__inline__ instead of inline. The INLINE hack compensated for it.
Ancient compilers are history.

Reported by:	glebius

(cherry picked from commit 9be9c1c084)
2022-02-07 05:51:15 -08:00
Cy Schubert
9ff592d868 ipflter: ANSIfy userland function declarations
Convert ipfilter userland function declarations from K&R to ANSI. This
syncs our function declarations with NetBSD hg commit 75edcd7552a0
(apply our changes). Though not copied from NetBSD, this change was
partially inspired by NetBSD's work and inspired by style(9).

Reviewed by:		glebius (for #network)
Differential Revision:	https://reviews.freebsd.org/D33595

(cherry picked from commit efeb8bffe3)
2022-02-07 05:51:15 -08:00
Cy Schubert
dd68201611 ipfilter userland: Path fixup no longer required
Since the move of ipfilter from contrib to sbin adjusting the source path
is no longer required.

Fixes:		41edb306f0

(cherry picked from commit 7cb2d7c413)
2022-02-07 05:51:14 -08:00
Cy Schubert
95daf09d07 ipfilter: Move userland bits to sbin
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sbin/ipf. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to sbin.

This is the second of three commits of the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
Differential Revision:		https://reviews.freebsd.org/D33510

(cherry picked from commit 41edb306f0)
2022-02-07 05:51:14 -08:00
Cy Schubert
5729ebba33 ipfilter: Move kernel bits to netpfil
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.

This is the first of three commits the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
Differential Revision:		https://reviews.freebsd.org/D33510

(cherry picked from commit 3b9b51fe46)
2022-02-07 05:51:14 -08:00
Kirk McKusick
c16f699d79 Whitespace and capitalization cleanups.
(cherry picked from commit c82df0a0bf)
2022-02-04 11:59:30 -08:00
Ed Maste
e5bcc6a856 route: remove write-only struct hostent from getaddr()
Under some INET/INET6 src.conf configurations sbin/route previously
failed to build due to an unused variable warning.  It was functionally
write-only anyway, so just remove it.

Reported by:	melifaro
Reviewed by:	melifaro
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33717

(cherry picked from commit c217390359)
(cherry picked from commit f567fcb2ff)
2022-01-26 19:35:40 -05:00
Rick Macklem
82dbca47a5 mount_nfs: Add a "bgnow" NFS mount option
The "bg" option does not go background until the initial mount
attempt fails, which can take 60+ seconds.

This new "bgnow" option goes background immediately, avoiding
the 60+ second delay, if the NFS server is not yet available.

The man page update is a content change.

PR:		260764

(cherry picked from commit 08a8d16cbb)
2022-01-25 15:25:06 -08:00
Andriy Gapon
82acfc0d78 add and use defintions for ATA power modes
Those can be returned by CHECK POWER MODE command (0xe5).
Note that some of the definitions duplicate definitions for Extended
Power Conditions.

(cherry picked from commit 75bc7150f4)
2022-01-25 09:43:11 +02:00
Li-Wen Hsu
7ce7a36db0
fsck(8): Fix typo
PR:		260949
Reported by:	Graham Perrin <grahamperrin@gmail.com>
MFC after:	3 days

(cherry picked from commit 6853ef66f1)
2022-01-15 20:34:18 +08:00
Konstantin Belousov
e01bceba24 ldconfig: remove two symbols
(cherry picked from commit fcbb1441d0)
2022-01-15 02:51:14 +02:00
Stefan Eßer
379bfb2aa9 sys/bitset.h: reduce visibility of BIT_* macros
(cherry picked from commit 5e04571cf3)
2022-01-14 18:17:30 +02:00
Hans Petter Selasky
d7c7e033da kldstat(8): style(9) fixes.
No functional change intended.

Differential revision:  https://reviews.freebsd.org/D32506
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 83237efcdb)
2022-01-07 14:23:09 +01:00
Hans Petter Selasky
5620ab6c8e kldstat(8): Fix indentation, whitespace to tabs.
No functional change intended.

Differential revision:  https://reviews.freebsd.org/D32502
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 337c814316)
2022-01-07 14:23:09 +01:00
Hans Petter Selasky
a8aaed1417 ifconfig(8): Don't set network interface capabilities when there is no change.
A quick grep through the kernel code shows network drivers compute the
changed bits of network capabilities after a SIOCSIFCAP IOCTL(2) by
using the bitwise exclusive or operation. When the set capabilities
are equal to the already read capabilities, no action will be taken.

Let ifconfig(8) predict this case and skip the SIOCSIFCAP IOCTL(2)
system call.

Discussed with:	kib@ (revert change in case of issues)
Sponsored by:	NVIDIA Networking

(cherry picked from commit ad8f078f66)
2022-01-07 14:11:32 +01:00