path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* ifconfig: fix incorrect wg allowed-ips netmaskMichael Chiu2021-02-151-1/+1
| | | | | | | | | | | | | | Currently when peer information is displayed with `ifconfig wgN peer ..` or `ifconfig wgN peer-list`, the netmask of the first `allowed-ips` will be used as the netmask of all CIDR in `allowed-ips`. For example, if the list is `,`, it will display as `,`. While this does not affect the actual functionality, it is very confusing. Submitted by: Michael Chiu <nyan -at- myuji.xyz> Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D28655 MFC after: 1 day
* mount_nullfs: rename a local variableAlan Somers2021-02-121-7/+7
| | | | | | | | | | | | | The "source" variable was introduced in r26072, probably as the traditional counterpart to "target". But the "source"/"target" names suggest the opposite of their actual meaning. With ln, for example, the source is the real file and the target is the newly created link. In mount_nullfs the meaning is the opposite: the target is the existing file system and the source is the newly created mountpoint. Better to use "target"/"mountpoint" terminology, which matches the man page. MFC after: 6 weeks Sponsored by: Axcient
* kldload(8): Improve phrasingDaniel Ebdrup Jensen2021-02-111-2/+3
| | | | | | | | | | | | | Mountroot isn't documented in the extant manual pages - so this phrasing, while less absolute and concise, still conveys which modules are recommended to be handled via loader.conf(5), and it also does a better job of elucidating that the modules can include filesystem drivers. Submitted by: kevans (earlier version) Reported by: imp, kevans, eugen Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D28542
* Revert "SO_RERROR indicates that receive buffer overflows should be handled ↵Alexander V. Chernikov2021-02-081-12/+1
| | | | | | | | as errors." Wrong version of the change was pushed inadvertenly. This reverts commit 4a01b854ca5c2e5124958363b3326708b913af71.
* SO_RERROR indicates that receive buffer overflows should be handled as errors.Alexander V. Chernikov2021-02-081-1/+12
| | | | | | | | | | | | 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.
* kldload(8): Add note about using kld_list in rc.conf(5)Daniel Ebdrup Jensen2021-02-081-1/+6
| | | | | | | | | While here, also recommend that loader.conf(5) should only be used in order to get to mountroot, as rc(8) is less fragile, faster, and is easier to fix by booting to single-user mode instead of having to blacklist modules in the loader. MFH: 2 weeks
* sbin/pfctl: fix tests after recent output changesAlex Richardson2021-02-042-2/+2
| | | | | | | | | The output now contains http-alt instead of 8080 and personal-agent instead of 5555. This was probably caused by 228e2087a32847fa51168f3f0c58f931cb2cb0f8. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28481
* sbin/bectl: Skip tests if sparse files are not supportedAlex Richardson2021-02-031-0/+7
| | | | | | | | | | | | | The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463
* Allow setting alias port ranges in libalias and ipfw. This will allow a systemNeel Chauhan2021-02-024-1/+47
| | | | | | | | | to be a true RFC 6598 NAT444 setup, where each network segment (e.g. user, subnet) can have their own dedicated port aliasing ranges. Reviewed by: donner, kp Approved by: 0mp (mentor), donner, kp Differential Revision: https://reviews.freebsd.org/D23450
* Register the bad read before bailing on terminal errors.Poul-Henning Kamp2021-02-021-9/+7
| | | | | This way running recoverdisk in a loop will not get stuck on a bad block which causes the disk or SD card detach.
* ipfw(8) crashes when ext6hdr option is omittedEvgeniy Khramtsov2021-02-011-0/+1
| | | | | | | | | | Verify that the option is passed, error out if it's not. The problem can be trivially triggered with `ipfw add allow ext6hdr`. PR: 253169 Reviewed by: kp@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447
* Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG.Gleb Smirnoff2021-01-292-9/+11
| | | | | | | | | Originally IFCAP_NOMAP meant that the mbuf has external storage pointer that points to unmapped address. Then, this was extended to array of such pointers. Then, such mbufs were augmented with header/trailer. Basically, extended mbufs are extended, and set of features is subject to change. The new name should be generic enough to avoid further renaming.
* sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodesRyan Moeller2021-01-271-1/+2
| | | | | | | | | | | | | | The OID is saved when we encounter CTLFLAG_SKIP so that descendants can be skipped as well. We then must not update the skip OID until we are out of the node. This was achieved by resetting the skip OID once the prefix no longer matches, but the case where the OID we reset on has CTLFLAG_SKIP was not accounted for. Reported by: mav Reviewed by: mav MFC after: 2 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D28364
* Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors.Kirk McKusick2021-01-261-2/+3
| | | | | | | | | | | | | | | | A long-standing bug in Pass 1 of fsck_ffs in which it is reading in blocks of inodes to check their block pointers. It failed to round up the size of the read to a disk block size. When disks would accept 512-byte aligned reads, the bug rarely manifested itself. But many recent disks will no longer accept 512-byte aligned reads but require 4096-byte aligned reads, so the failure to properly round-up read sizes to multiples of 4096 bytes makes the error much more likely to occur. Reported by: Peter Holm and others Tested by: Peter Holm and Rozhuk Ivan MFC after: 3 days Sponsored by: Netflix
* pfctl: FreeBSD now supports DIOCGIFSPEEDKristof Provost2021-01-251-29/+0
| | | | | | | | | | There's no need for a special case here to work around the lack of DIOCGIFSPEED. That was introduced in FreeBSD in c1aedfcbd9896401f637bc815ba4e51dca107f6f. Reported by: jmg@ Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28305
* ifconfig: fix UBSan signed shift errorAlex Richardson2021-01-251-1/+1
| | | | Use 1u since UBSan complains about 1 << 31.
* build: remove LIBPTHREAD/LIBTHR build optionsKyle Evans2021-01-221-7/+2
| | | | | | | | | | | | | | | | | | WITHOUT_LIBTHR has been broken for a little over five years now, since the xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building a useful system without threading support is becoming increasingly more difficult. Additionally, in the five plus years that it's been broken more reverse dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among others) that make it more and more difficult to reconcile the effort needed to fix these options. Remove the broken options. PR: 252760 Reviewed by: brooks, emaste, kib Differential Revision: https://reviews.freebsd.org/D28263
* ifconfig: add vlanproto "qiniq" as an alias for "802.1ad"Allan Jude2021-01-202-2/+8
| | | | | | | | | | QinQ is better known by this name, so accept it as an alias Reported-by: Mike Geiger Reviewed-by: melifaro, hselasky, rpokala MFC-with: 366917 Sponsored-by: Klara Inc. Differential-Revision: https://reviews.freebsd.org/D28245
* mount_nfs: update man page description for oneopenownRick Macklem2021-01-181-1/+14
| | | | | | | | | | | | | | | | | | | | | | | A recent email discussion indicated that a large accumulation of NFSv4 Opens was occurring on a mount. This appears to have been caused by a shared library within the mount being used by several processes, such that there is always at least one of these processes running. A new Open was created by each process and were not closed, since all the Opens were never closed. This is alleviated by using the "oneopenown" mount option. This man page update attempts to indicate the use of "oneopenown" for this case. This is a content change. Reported by: j.david.lists@gmail.com Reviewed by: 0mp MFC: 1 month Differential Revision: https://reviews.freebsd.org/D28215
* Remove remnants of classful behavior in route(8).Alexander V. Chernikov2021-01-161-55/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Curently route(8) treats some addresses as network addresses: RTA_DST: inet; RTA_NETMASK: inet; RTA_IFP: link ; RTM_GET: Report Metrics: len 240, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,STATIC> locks: inits: sockaddrs: <DST,NETMASK,IFP> link#0 Note added `RTA_NETMASK` in the request. Host address from the same network is ok: route -nv get RTA_DST: inet RTA_IFP: link RTM_GET: Report Metrics: len 224, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC> ... route to: destination: mask: This change eliminates network auto-guessing part AND reading network from /etc/networks. Reviewed By: rgrimes Differential Revision: https://reviews.freebsd.org/D24401
* bectl: remove spurious aok variableKyle Evans2021-01-161-2/+0
| | | | | | | | This rode in with the OpenZFS import. It may have been necessary at some point, but it is no longer and it breaks the WITHOUT_DYNAMICROOT build as it collides with the definition in libspl. Reported-by: Michael Dexter
* bectl: tests: use -R <mount> instead of specifying altrootKyle Evans2021-01-161-1/+1
| | | | | | | | -R is currently shorthand for cachefile=none, altroot=<mount>. This is functionally the same, but perhaps more resilient to future changes that could be necessary that may be added when -R is specified. MFC after: 1 week
* ICMP checksum test: Fix for big endianCharlie Root2021-01-121-64/+20
| | | | | | | | | | | | | The in_cksum tests originally tried to simulate a BE environment by swapping the byte order of the input. But that's overcomplicated, and didn't actually work on real BE hardware. The correct testing strategy is just to test on the native endianness, and run the tests in both BE and LE environments. Submitted by: Renato Riolino <renato.riolino@eldorado.org.br> Reviewed By: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23193
* pfctl: Another set skip <group> fixKristof Provost2021-01-111-1/+21
| | | | | | | | | | | | | | When retrieving the list of group members we cannot simply use ifa_lookup(), because it expects the interface to have an IP (v4 or v6) address. This means that interfaces with no address are not found. This presents as interfacing being alternately marked as skip and not whenever the rules are re-loaded. Happily we only need to fix ifa_grouplookup(). Teach it to also accept AF_LINK (i.e. interface) node_hosts. PR: 250994 MFC after: 3 days
* Fix 32-bit build post 6733401935f83754b4b2744bc3d33ef84b1271e0Dimitry Andric2021-01-081-1/+1
| | | | | | The general style in sbin/nvmecontrol apppears to print uint64_t types using %j, so I'm using that instead of the more general (but admittedly ugly) PRIu64.
* Fix 32-bit build post 5cc52631b3b88dfc36d8049dc8bece8573c5f9af.Cy Schubert2021-01-081-3/+3
* nvmecontrol: add device self-test op and log pageChuck Tuffli2021-01-084-1/+263
| | | | | | | | | | Add decoding of the Device Self-test log page and the ability to start or abort a test. Reviewed by: imp, mav Tested by: Muhammad Ahmad <muhammad.ahmad@seagate.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27517
* Rewrite the disk I/O management system in fsck_ffs(8). Other thanKirk McKusick2021-01-0717-1384/+1215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | making fsck_ffs(8) run faster, there should be no functional change. The original fsck_ffs(8) had its own disk I/O management system. When gjournal(8) was added to FreeBSD 7, code was added to fsck_ffs(8) to do the necessary gjournal rollback. Rather than use the existing fsck_ffs(8) disk I/O system, it wrote its own from scratch. Similarly when journalled soft updates were added in FreeBSD 9, code was added to fsck_ffs(8) to do the necessary journal rollback. And once again, rather than using either of the existing fsck_ffs(8) disk I/O systems, it wrote its own from scratch. Lastly the fsdb(8) utility uses the fsck_ffs(8) disk I/O management system. In preparation for making the changes necessary to enable snapshots to be taken when using journalled soft updates, it was necessary to have a single disk I/O system used by all the various subsystems in fsck_ffs(8). This commit merges the functionality required by all the different subsystems into a single disk I/O system that supports all of their needs. In so doing it picks up optimizations from each of them with the results that each of the subsystems does fewer reads and writes than it did with its own customized I/O system. It also greatly simplifies making changes to fsck_ffs(8) since everything goes through a single place. For example the ginode() function fetches an inode from the disk. When inode check hashes were added, they previously had to be checked in the code implementing inode fetch in each of the three different disk I/O systems. Now they need only be checked in ginode(). Tested by: Peter Holm Sponsored by: Netflix
* Reference newfs_msdos(8) from the newfs(8) manualMateusz Piotrowski2021-01-071-1/+2
| | | | | | PR: 252484 Reported by: Graham Perrin <grahamperrin@gmail.com> MFC after: 3 days
* Fix bug in expanding lost+found direct blocks.Kirk McKusick2021-01-071-1/+1
| | | | | Reported by: Peter Holm Sponsored by: Netflix
* bectl(8): sync man page and help textRobert Wing2021-01-062-11/+9
| | | | | | | | | | | | | | Sync man page with behavior of bectl(8). Sync help text with man page. PR: 246697 Reported by: olgeni Submitted by: olgeni (with changes) Reviewed by: kevans, olgeni Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27482
* pfctl: Stop sharing pf_ruleset.c with the kernelKristof Provost2021-01-052-3/+343
| | | | | | | | | | | | | | Now that we've split up the datastructures used by the kernel and userspace there's essentually no more overlap between the pf_ruleset.c code used by userspace and kernelspace. Copy the userspace bits to the pfctl directory and stop using the kernel file. Reviewed by: philip MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D27764
* pkgbase: Move bectl to the runtime packageEmmanuel Vadot2021-01-041-0/+1
| | | | | | | runtime contain what is needed to boot in single user and repair a system, bectl could be handy to have in this situation. Differential Revision: https://reviews.freebsd.org/D27708
* sbin/camcontrol: use calloc/strlcpy where appropriate.Xin LI2021-01-043-9/+6
| | | | MFC after: 2 weeks
* The fsck_ffs program had previously only been able to expand the sizeKirk McKusick2021-01-031-35/+92
| | | | | | | | | | | | of its lost+found directory by allocating direct block pointers. The effect was that it was limited to about 19,000 files. One of Peter Holm's tests produced a filesystem with about 23,000 lost files which meant that fsck_ffs was unable to recover it. This update allows lost+found to be expanded into a single indirect block which allows it to store up to about 6,573,000 lost files. Reported by: Peter Holm Sponsored by: Netflix
* ping: fix ping when the kernel was built without INET6Alan Somers2021-01-011-9/+15
| | | | | | | | | | | If the kernel was built without INET6, default to ICMP. Or, if it was built without INET, default to ICMPv6. PR: 251725 Reported by: jbeich Reviewed by: jbeich Tested by: jbeich MFC with: 368045
* Correct and add some comments.Kirk McKusick2020-12-311-7/+7
| | | | Sponsored by: Netflix
* ldconfig: Retire a.out supportEd Maste2020-12-313-512/+15
| | | | | | | | | | | | aout support in ldconfig hasn't been required since FreeBSD 2.x. If someone needs to use FreeBSD 2 shared libraries they will be best served by using a FreeBSD 2 ldconfig as well. In aa5e1b42e6e3 we removed the ldconfig a.out invocation from rc.d but left the support in ldconfig itself. Remove it now. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27481
* dump(8): clarify the recommended use of cache and snapshotsGuangyuan Yang2020-12-281-4/+6
| | | | | | | | PR: 131626 MFC after: 1 week Submitted by: Andrew Hamilton-Wright <andrew@qemg.org> Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D27775
* dumpon(8): Add missing section argumentsGordon Bergling2020-12-281-6/+6
| | | | MFC after: 3 days
* newfs(8): Fix unusual Xr orderGordon Bergling2020-12-281-1/+1
| | | | | | - unusual Xr order: gjournal after gpart MFC after: 3 days
* sbin/init: Reduce code duplication by using %m for error messageXin LI2020-12-261-28/+25
| | | | | | instead of passing %s with return value from strerror(). MFC after: 2 weeks
* sbin/routed: Remove unused code for sgi and NetBSD.Xin LI2020-12-2611-142/+0
| | | | MFC after: 2 weeks
* mount_nfs(8): add a description for the new "tlscertname" optionRick Macklem2020-12-241-1/+31
| | | | | | | | | | commit 665b1365fe8e added a new NFS mount option that is used to set a non-default X.509 certificate, that can be used for nfs-over-tls NFS mounts. This patch adds a description for it to the man page. Reviewed by: 0mp Differential Revision: https://reviews.freebsd.org/D27733
* sbin/sysctl: Style fixRyan Moeller2020-12-231-1/+1
| | | | | | | Remove parameter names from function prototype to match other prototypes in the file. Sponsored by: iXsystems, Inc.
* sbin/sysctl: Always honor skip in sysctl_allRyan Moeller2020-12-231-3/+1
| | | | | | | | | | | | | | | | Fix broken CTLFLAG_SKIP when present on the first child of the requested node. We don't need to ignore skip for the first node because in sysctl_all() we've implicitly visited the first node already when oid is specified. The first call to show_var() in here is after we have iterated to the next node. When the command line specifically requests a non-node sysctl we go straight into show_var() without calling sysctl_all(). Reported by: jhb Reviewed by: jhb Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D27674
* ipfw(8): Fix a few mandoc related issuesGordon Bergling2020-12-191-48/+50
| | | | | | | | | | | | | | | | - no blank before trailing delimiter - missing section argument: Xr inet_pton - skipping paragraph macro: Pp before Ss - unusual Xr order: syslogd after sysrc - tab in filled text There were a few multiline NAT examples which used the .Dl macro with tabs. I converted them to .Bd, which is a more suitable macro for that case. MFC after: 1 week Notes: svn path=/head/; revision=368804
* ping(8): Fix a mandoc related issueGordon Bergling2020-12-191-1/+1
| | | | | | | - unusual Xr punctuation: none before traceroute6(8) Notes: svn path=/head/; revision=368803
* nvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO sectionGordon Bergling2020-12-191-5/+9
| | | | | | | | | | | | | | | - inserting missing end of block: Ss breaks Bl - skipping paragraph macro: Pp before Ss - referenced manual not found: Xr nvme 4 (2 times) - unknown standard specifier: St The The macro .St can only be used for standards known by mdoc(7). So add a SEE ALSO section and add a reference to the NVM Express Base Specification. MFC after: 2 weeks Notes: svn path=/head/; revision=368802
* devd.conf(5): Fix a mandoc related issueGordon Bergling2020-12-191-3/+3
| | | | | | | | | - sections out of conventional order: Sh SEE ALSO MFC after: 1 week Notes: svn path=/head/; revision=368800