Commit Graph

10052 Commits

Author SHA1 Message Date
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