1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

10700 Commits

Author SHA1 Message Date
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
Kristof Provost
250e074e5f pfctl tests: fix dependency
Ensure that we rebuild the test binary when we add tests (i.e. modify
pfctl_test_list.inc).

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-25 15:06:25 +02:00
Juraj Lutter
a8a9527736 pfctl: Allow a semicolon (;) as a comment
To make parsing of, for example, Spamhaus' drop.txt and similar
files that contains semicolons as comments, allow them also
in file-based tables.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46088
2024-07-25 15:06:24 +02:00
Kyle Evans
158f319428 route: avoid overlapping strcpy
Passing overlapping buffers to strcpy yields an undefined result, so
let's avoid it. The copy doesn't really need to happen anyways, we can
just point to the domain part of the hostname.

This was discovered with _FORTIFY_SOURCE.

Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Reviewed by:	allanjude, emaste, imp, melifaro (all previous version)
Differential Revision:	https://reviews.freebsd.org/D32615
2024-07-23 15:25:56 -05:00
Konrad Witaszczyk
bb8fa2ef83 sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq
The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq
structure object, as its argument.

Reviewed by:	brooks, jhb, oshogbo
Approved by:	oshogbo (mentor)
Obtained from:	CheriBSD
Differential Revision: https://reviews.freebsd.org/D46017
2024-07-22 09:58:37 +00:00
Kristof Provost
9ae91f59c5 pf: convert DIOCGETADDR to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-22 09:11:49 +02:00
Kristof Provost
644b7b5a2e pf: convert DIOCGETADDRS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-22 09:11:49 +02:00
Ryan Libby
90818083d7 ipf: correct size limit in snprintf
Reported by:	GCC -Wsizeof-pointer-memaccess
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D45899
2024-07-20 09:14:57 -07:00
John Baldwin
6991cb36f5 recoverdisk: Consistently use item count as the first argument to calloc
Reported by:	GCC 14 -Wcalloc-transposed-args
Reviewed by:	rlibby, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D46010
2024-07-19 13:06:25 -04:00
John Baldwin
e8e2ab3c55 md5: Consistently use item count as the first argument to calloc
Reported by:	GCC 14 -Wcalloc-transposed-args
Reviewed by:	rlibby
Differential Revision:	https://reviews.freebsd.org/D46009
2024-07-19 13:06:20 -04:00
John Baldwin
ee912ee57a nvmecontrol: Treat requested KeepAlive timeout as seconds
The internal KATO is stored in milliseconds, so convert the command
line argument (given in seconds) to milliseconds before passing to
nvmf_connect().

Sponsored by:	Chelsio Communications
2024-07-18 14:54:43 -04:00
Kristof Provost
d909f06b90 pf: convert DIOCADDADDR to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-07-17 07:52:55 +02:00
Warner Losh
e9ac41698b Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
2024-07-15 16:43:39 -06:00
Yuichiro NAITO
ac6dc5cde7 dhclient: Ignore SIP servers DHCP option defined in RFC 3361
Ignore SIP servers dhcp option to shut up the warning message.
This option is defined in the RFC 3361 and sent from NSD-G1000T router.

PR:		280119
Reviewed by:	jrm (mentor), brooks
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45873
2024-07-15 19:42:17 +02:00
Kyle Evans
41c233dec6 Prepare some build fixes in advance of more _FORTIFY_SOURCE
ZFS' libspl needs to be made aware that we have strlcat(3) and
strlcpy(3) to avoid some more complicated declaration duplication, so
go ahead and define these HAVE_ macros now.

libprocstat has to define `_KERNEL` and include kernel headers in order
to get what it wants, but this results in sys/cdefs.h being included too
late and we pick up the build breaking version of the __RENAME
definition.  Just explicitly include sys/cdefs.h earlier rather than
disabling _FORTIFY_SOURCE.  The zfs/ subdir only builds an object that
holds some structures and sizes, so just disable _FORTIFY_SOURCE there
entirely rather than trying to move #define _KERNEL into the file..

While we're here, make sure that we disable _FORTIFY_SOURCE in the
bootloader because we don't have the symbol renaming support today to do
it as cleanly as we'd like.  ssp/ssp.h needs to be pulled into the libsa
environment so that other bits can understand that ssp is disabled in
the consistent __SSP_FORTIFY_LEVEL way that we try to do.

Reviewed by:	allanjude (previous version), markj
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D45676
2024-07-13 00:16:23 -05:00
Alexander Motin
6ac0f711ad nvmecontrol: Fix "Workloadd" typo
MFC after:	1 week
2024-07-12 11:36:40 -04:00
Konstantin Belousov
9d269938e3 ipsec_offload: ifconfig support
Sponsored by:	NVIDIA networking
2024-07-12 06:29:32 +03:00
Konstantin Belousov
83418c878b setkey(8): add -hwif extension to specify offload interface for SA and SPD
Sponsored by:	NVIDIA networking
2024-07-12 06:29:32 +03:00
Konstantin Belousov
9b93b2d8b0 setkey(8): add -esn extension option to enable ESN
Sponsored by:	NVIDIA networking
2024-07-12 06:29:32 +03:00
Alexander Ziaee
de2ab11ff9 manuals/description: system video console utilitys
Update the man page descriptions so that apropos are more consistent for
console related man pages.

Motive:		apropos results: clarify consistently
MFC after:	3 days
Reviewed by:	emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1275
2024-07-07 08:54:22 -06:00