1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
Commit Graph

10719 Commits

Author SHA1 Message Date
Pedro F. Giffuni
b88df1e893 Reapply "sbin/ping: allow normal users to specify larger packets"
The ping tests were originally broken by an unrelated isue that
is now fixed ( 2926c25942 ).

THanks to kp@ for fixing the test and Jose Luis Duran for pinting it out.

This reverts commit 7bc0cb91a2.
2024-10-16 13:39:48 -05:00
Kristof Provost
2926c25942 ping tests: fix for scapy-2.6.0
Scapy 2.6.0 now appears to parse the IPOption during construction, and it then
gets confused at a single-byte option. IP Options typically contain at least a 1
byte type and 1 byte length. Avoid this by just returning the raw bytes, rather
than an IPOption object.

MFC after:	1 week
Reviewed by:	Jose Luis Duran <jlduran@gmail.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47151
2024-10-16 17:25:57 +02:00
Pedro F. Giffuni
7bc0cb91a2 Revert "sbin/ping: allow normal users to specify larger packets"
It is causing test failures.

This reverts commit 80a5b26871.
2024-10-16 00:23:58 -05:00
Pedro F. Giffuni
80a5b26871 sbin/ping: allow normal users to specify larger packets
Only super-user could specify a packet size larger than the default 56 bytes.
This restriction was added by Matt Dillon in 1998 during the BEST days [0].
This restriction doesn't exist in ping IPV6 or on NetBSD, OpenBSD and Linux.

UMS [1] uses this feature to estimate the client's bandwidth to optimize the
streaming experience.

[0] DFGit 526f06b278
[1] UMS: https://github.com/UniversalMediaServer/UniversalMediaServer

Obtained from:	DragonFlyBSD
Differential Revision:  https://reviews.freebsd.org/D45774
2024-10-15 20:05:50 -05:00
Graham Percival
6e1fc01180 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464
2024-10-15 17:18:14 -03:00
Kristof Provost
9c12533672 pf: convert DIOCGETSRCNODES to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-10-15 16:29:11 +02:00
Simon J. Gerraty
a64729f507 Update Makefile.depend files
After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:	stevek
2024-10-14 10:26:17 -07:00
Ed Maste
86e66321bb fdisk: emit deprecation notice when run
Requested by:	rgrimes
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43585
2024-10-13 13:52:14 -04:00
Ed Maste
255d2d9bbc fdisk: add deprecation/removal notice to man page
As of 2015 (commit b8c19fd719) the fdisk man page claimed the command
is obsolete, but had no explicit mention of removal.  Add another note
that follows our current deprecation notice format.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47067
2024-10-13 13:45:28 -04:00
Yan-Hao Wang
183e8aa749
mount(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41390
2024-10-13 02:21:47 +08:00
Warner Losh
2af5769e34 fdisk: Make confusing fdisk messages a little less ambiguous
We print an error when we can't read the MBR. Add minimal messages about
continuing anyway.

PR: 167036
Sponsored by:		Netflix
2024-10-11 12:06:33 -06:00
Kristof Provost
48f5bf8be6 pf: convert DIOCGETRULESET to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46938
2024-10-10 14:10:41 +02:00
Kristof Provost
6562157dfa pfctl: avoid possible SIGSEGV when wrong tos option
Obtained from:	OpenBSD, haesbaert <haesbaert@openbsd.org>, 934eaac797
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46933
2024-10-10 14:10:40 +02:00
Kristof Provost
25e0f8f99f pf: convert DIOCGETRULESETS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46930
2024-10-10 14:10:40 +02:00
Kristof Provost
ee9f418c80 pfctl: correctly print skip steps in -vv mode
- Changed order of address and ports.

Obtained from:	OpenBSD, mcbride <mcbride@openbsd.org>, 0bcfb1e086
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46926
2024-10-10 14:10:39 +02:00
Graham Percival
d21e322d56 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1448
2024-10-07 15:40:58 -03:00
Graham Percival
4f2ef756a4 manuals: Fix "skipping end of block" .Ed errors
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .Ed commands.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1435
2024-10-03 14:49:23 -03:00
Kirk McKusick
5b21d4ad06 Ensure that soft updates are not enabled by default when using mdmfs(8)
When soft updates began being enabled by default that change carried
over to mdmfs(8) which does not want or need them. This fix ensures
that they are only enabled in mdmfs(8) when requested with the -U flag.

Reported by: Ivan Rozhuk
Tested by:   Ivan Rozhuk
PR:          279308
MFC after:   1 week
2024-10-03 08:06:28 -07:00
Kristof Provost
288bec2b2b pf: fold pf_test_fragment() into pf_test_rule()
Reduces code and fixes a bunch of bugs with fragment handling not being in sync
with the rest of the ruleset.

Much feedback from mpf, bluhm & markus
Thanks to Tony Sarendal for help with testing

ok bluhm; various previous versions ok henning, claudio, mpf, markus

Note that while this changes the order of src addr/src port/dst addr/dst port
skips this doesn't actually affect the kernel/userspace ABI. The kernel always
recalculates skip steps. As a result we have to fix one of the pfctl parser
tests. Note that this is an order change that does not affect what packets are
acceppted or dropped.

Obtained from:	OpenBSD, mcbride <mcbride@openbsd.org>, 04c69899a7
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46705
2024-10-01 09:55:13 +02:00
Michael Osipov
38c63b5283 dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925
Ignore DHCP options 124 and 125 to shut up the warning messages.
These options are defined in the RFC 3925.

PR:		281361
Reviewed by:	jrm (mentor), otis (mentor), thj
Tested by:	jlduran@gmail.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46760
2024-09-28 10:49:02 +02:00
Graham Percival
ce251baf42 ipf.5: revert C style(9) applied to man page
These changes were made by accident in:
    ipfilter: Adjust userland returns to conform to style(9)
    2582ae5740

That commit made similar mistakes in other man pages, but those have
already been fixed.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1433
2024-09-24 14:29:39 -03:00
David E. Cross
1b1e392aed ggate: Add support for O_DIRECT access
Adds support for controlling O_DIRECT access to ggated, ggatec, and
ggatel.

Reviewed by:	markj
Relnotes:	yes
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D45056
2024-09-21 13:05:22 +00:00
Alexander Ziaee
2a680c5c37 sysctl.8: mark sysctls as vars per style.mdoc(7)
+ while here, fix alignment and tag SPDX

MFC after:	3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1421
2024-09-21 05:25:16 -06:00
Kristof Provost
7309c551a5 pf tests: test the new log(matches) feature
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46589
2024-09-19 22:20:13 +02:00
Kristof Provost
f3ab00c2b6 pf: add a new log opt PF_LOG_MATCHES
forces logging on all subsequent matching rules
new log opt "matches"
awesome for debugging, a rule like
match log(matches) from $testbox
will show you exactly which subsequent rules match on that packet
real ok theo assumed oks ryan & dlg bikeshedding many

Obtained from:	OpenBSD, henning <henning@openbsd.org>, 1603e01ae4
Obtained from:	OpenBSD, henning <henning@openbsd.org>, f496e91672
Obtained from:	OpenBSD, henning <henning@openbsd.org>, 07481a9fee
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46588
2024-09-19 22:20:13 +02:00
Kristof Provost
e044f67a66 pfctl: improve bitmask printing
In some cases the netmask gets set to a full 128 bit mask even if no
address family is selected; don't print the v6 mask if it's a v4 address.

Obtained from:	OpenBSD, mcbride <mcbride@openbsd.org>, f6d7b41f07
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46584
2024-09-19 22:20:12 +02:00
Kristof Provost
80eb861dc2 pfctl: lex <=, >=, and != into a single token
lex <=, >=, and != into a single token for correctness and to reduce the
lookahead in the parser
ok henning otto

Reviewed by:	zlei
Obtained from:	OpenBSD, deraadt <deraadt@openbsd.org>, e6e3ecf338
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46582
2024-09-16 13:48:58 +02:00
Kristof Provost
637d81c52d pfctl: fix incorrect optimization
In the non-optimized case, an address list containing "any" (ie. { any 10.0.0.1 })
should be folded in the parser to any, not to 10.0.0.1.  How long this bug has
been with us is unclear.
ok guenther mcbride

Obtained from:	OpenBSD, deraadt <deraadt@openbsd.org>, e3b4bc25a0
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46580
2024-09-16 13:48:49 +02:00
Kristof Provost
661d0031bb pf tests: test the new received-on feature
Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46578
2024-09-16 13:48:20 +02:00
Kristof Provost
2339ead638 pf: allow filtering on the receive interface
add support to pf for filtering a packet by the interface it was received
on. use the received-on IFNAME filter option on a pf.conf rule to restrict
which packet the interface had to be received on. eg:

  pass out on em0 from $foo to $bar received-on fxp0

ive been running this in production for a week now. i find it particularly
usefull with interface groups.

no objections, and a few "i like"s from henning, claudio, deraadt, mpf

Obtained from:	OpenBSD, dlg <dlg@openbsd.org>, 95b4320893
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46577
2024-09-16 13:47:07 +02:00
Alexander Ziaee
a5770eb54f geom.8: minor cleanup (markup, spdx, gsched)
Fixes:		86c06f (Remove GEOM_SCHED class and gsched)
MFC after:	3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1380
2024-09-06 12:34:33 -06:00
Alexander Ziaee
0d8effbd6e growfs.8: align and alphabetize options
MFC after:	3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1379
2024-09-06 12:34:32 -06:00
Mark Johnston
00c9a6806c ifconfig: Add an allmulti verb
Similar to "promisc", this allows the IFF_ALLMULTI flag to be toggled
from userspace if it happens to be useful to disable multicast packet
filtering.  One use-case is when implementing IPv6 neighbour discovery
over netmap.

Reviewed by:	zlei, glebius
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D46525
2024-09-06 16:58:44 +00:00
Tom Jones
e1b1984abb pfctl: Add endpoint-independent test to the list of tests
Reviewed by:	kp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46563
2024-09-06 14:09:12 +01:00
Tom Jones
390dc369ef pf: Add support for endpoint independent NAT bindings for UDP
With Endpoint Independent NAT bindings for UDP flows from a NATed source
address are always mapped to the same ip:port pair on the NAT router.
This allows a client to connect to multiple external servers while
appearing as the same host and enables NAT traversal without requiring
the client to use a middlebox traversal protocol such as STUN or TURN.

Introduce the 'endpoint-independent' option to NAT rules to allow
configuration of endpoint independent without effecting existing
deployments.

This change satisfies REQ 1 and 3 of RFC 4787 also known as 'full cone'
NAT.

Using Endpoint Independent NAT changes NAT exhaustion behaviour it does
not introduce any additional security considerations compared to other
forms of NAT.

PR:             219803
Co-authored-by: Damjan Jovanovic <damjan.jov@gmail.com>
Co-authored-by: Naman Sood <mail@nsood.in>
Reviewed-by:	kp
Sponsored-by:   Tailscale
Sponsored-by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11137
2024-09-06 13:48:04 +01:00
Konstantin Belousov
4f39ff1ea0 setkey(8): document -hwif extension
Sponsored by:	NVidia networking
2024-08-25 17:46:09 +03:00
Kristof Provost
6a88e22728 pfctl: pfik_ifp is always NULL
The pfik_ifp field is not provided by the kernel, it is always NULL. Do not
check for it. This caused us to not clear the skip flag on interfaces, leading
to unexpected behaviour when a 'set skip' was removed.

PR:		280834
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46311
2024-08-19 18:02:15 +02:00
Kajetan Staszkiewicz
788f194f60 pf: 'sticky-address' requires 'keep state'
When route_to() processes a packet without state, pf_map_addr() is called for
each packet. Pf_map_addr() will search for a source node and will find none
since those are created only in pf_create_state(). Thus sticky address,
even though requested in rule definition, will never work.

Raise an error when a stateless filter rule uses sticky address to avoid
confusion and to keep ruleset limitations in sync with what the pf code
really does.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46310
2024-08-16 11:43:00 +02:00
Warner Losh
a233cb6914 nvmecontrol: Accept -a {1,2,3,4} for sanitize command for nvme-cli compat
Linux's `nvme sanititze -a` takes a number, not a string. Accept 1-4 for
compatibility so vendor's recepies are easier to implmement.

Sponsored by: Netflix
2024-08-15 20:22:31 -06:00
Isaac Cilia Attard
84fce4b67a dhclient: Update dhclient man page for n flag
Document new n flag for disabling ARP resolution within dhclient.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368
2024-08-09 14:49:47 -07:00
Isaac Cilia Attard
b51569ad3c dhclient: Make arp_timeout configurable
Make arp_timeout available to dhclient.c, set the default timeout to 250
ms, and provide a new command-line argument, 'n' for setting the timeout
to 0.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368
2024-08-09 14:49:43 -07:00
Isaac Cilia Attard
f0a38976b0 dhclient: Use clock_gettime() instead of time()
Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368
2024-08-09 14:49:39 -07:00
Isaac Cilia Attard
76e0ffd9f8 dhclient: Timeouts for entering state_selecting
Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368
2024-08-09 14:49:11 -07:00
Isaac Cilia Attard
16a235f23c dhclient: Switch timeouts from time_t to timespec
Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter function to retain compatibility with the rest of the codebase.
No functional change intended.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368
2024-08-09 14:45:06 -07:00
Kyle Evans
d349bd3533 shutdown: fix option sorting
A last minute change moved this from -W to -q; fix the sorting in a few
places to reflect that.

Fixes: 6c7ec630c2 ("shutdown: add a -q(uiet) flag to suppress [...]")
Sponsored by:	Klara, Inc.
2024-08-09 11:21:00 -05:00
Kyle Evans
6c7ec630c2 shutdown: add a -q(uiet) flag to suppress warning messages
The system-wide warning makes sense in multi-user environments, but
shutdown(8) may be used on systems or in scenarios where there's nobody
to warn and wall(1) just introduces unnecessary complexity and overhead
to the shutdown process.

Add an option to suppress the warning entirely for those contexts that
want to do so, which are anticipated to mainly be in appliance or
single-user desktop-style systems.

Reviewed by:	des
Reviewed by:	allanjude, imp (earlier version)
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D46216
2024-08-09 11:01:11 -05:00
Simon J. Gerraty
b77f618568 Add examples to veriexec(8)
Add missing flags to veriexec(8) as well as some examples to
help explain usage.

Also add veriexec.4

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D46207
2024-08-01 14:59:52 -07:00
Ed Maste
5c2bc3db20 Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:	The FreeBSD Foundation
2024-07-30 12:16:36 -04:00
Alexander Ziaee
ad57cea9e6 adjkerntz.8: minor cleanup (markup, spdx, reflow)
+ real-time and rtc added to search keywords
- local dropped from search keywords
+ ntpd added to see also
+ use machine independent language

Reported by: emaste (MI language)
MFC after: 3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1326
2024-07-29 14:06:06 -06:00
Kristof Provost
375aaa299f pfctl: improve error reporting
libpfctl doesn't set errno, instead it returns error codes. Take that into
account when handling errors so that we report the actual error.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-29 19:42:25 +02:00