The computation of the length was not taking into account that IPv6
endpoints, which are not IPv6 only, have a suffix of 46.
For UDP and TCP this bug was not relevant, since tcp46 and udp46
has the same length as PROTO, but sctp46 is longer. Upcoming
udplite support will also be affected.
Reviewed by: asomers
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53212
Sometimes one or the other but not both tools are present; this ensures
that all cases are correctly handled.
Reported by: cperciva
Approved by: cperciva (re)
Sponsored by: SkunkWerks, GmbH
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53186
MFC after: 2 days
There're some other drivers want to register and unregister linux
ioctl handler. Move the macro LINUX_IOCTL_SET from tdfx_linux.h to
linux_ioctl.h so that they can also benefit it.
While here, rename the declaration of linux ioctl function to be
consistent with the name of the handler.
Meanwhile, drop a comment about the macro, since its function is
obvious.
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D53158
Also fix some typos and move a couple NULL checks earlier.
Reviewed by: mckusick, Johan Söllvander, markj, kevans, adrian
Fixes: 0d4642a67e
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53180
Add -F fmt option to give a free format string to git show --pretty=.
It can be used, for example, as:
./tools/tools/git/mfc-candidates.lua -F "%h %cD %s"
to see which commits have passed the minimum 3 days of waiting before
MFCing, or to see which group of commits belong together.
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53172
Ensure we always have a non-NULL rule pointer (ctx.rm).
It might have gotten set to NULL by pf_get_translation().
While here also restore the previous rdr behaviour be re-adding the incorrectly
removed 'break' in pf_match_translation_rule.
PR: 290177
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D53191
The variable is simply a long series of flags. Mark as boolean to allow
the compiler to use smaller types.
Convert to designated initializer to better indicate which operations it
is set for. Without this the array is kind of long and sparse.
nfsv4_setsequence() is no longer used outside nfs_commonsubs.c, so now
mark it as static. The fourth argument is true/false, so convert to
boolean.
No semantics change is made by this commit.
Discussed with: jrtc27
MFC after: 2 weeks
We only need to check for unMETALOGed directories and sort the METALOG
file if we're using it, i.e. if we're doing a NO_ROOT build. This
non-NO_ROOT builds by no longer bogusly writing to /METALOG*.
We only need to add databases (spwd.db etc) to METALOG if we're doing
a pkgbase-enabled NO_ROOT build; but we should always do this before
creating the filesystem, not only if we installed extra packages (in
vm_extra_install_packages, where that code was erroneously placed).
This fixes non-cloud VM images, which in 15.0-BETA2 shipped without
password databases.
Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53194
This is a small cleanup to consolidate the considered lost reduction and marking to an
inline function. There are two places where we are using hookery in SACK processing where
we can't use it. All other places we move to the function. This code in theory changes nothing
and just makes things a bit more readable and consistent.
Reviewed by:tuexen
Differential Revision: <https://reviews.freebsd.org/D53021>
Allow umask to be configurable.
Being able to set the umask via an rc variable is useful when setting:
security.bsd.unprivileged_read_msgbuf=0
As it allows a user to configure:
dmesg_umask="066"
Without modifying the rc script, and preventing the contents of the
$dmesg_file (/var/run/dmesg.boot) from being publicly readable.
PR: 272552
Reviewed by: netchild
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D53169
Our versions of these functions (originally taken from BIND) simply
don't work correctly for AF_INET6. These were removed from BIND itself
quite a while ago, but OpenBSD has made several fixes in the mean time,
so import their code.
Add tests for both functions.
PR: 289198
Reported by: Nico Sonack <[email protected]>
MFC after: 1 week
Reviewed by: des
Obtained from: OpenBSD (lib/libc/net)
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52629
The created kqueue is copied on fork, together with the registered
events. This means that a new kqueue is created at the same fd index
as the parent' kqueue, and all registered events are copied into the
new kqueue (when possible). The current active events list is also
duplicated.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52045
The new helper function allows to allocate a kqueue and its file,
without also allocating file descriptor.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52045
The proc is the owner of the copied filedesc.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52045
instead of referencing or ignoring.
The pass to handle copying is performed after all passable files are
installed into the new file descriptor's table, since one of the future
consumers of this interface (kqueue) needs all passable file descriptors
already valid. After all fds are installed, the additional call for each
copyable file is done to copy the underlying object.
[MFC note: use fo_spares for fo_fork]
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52045
gcc complains about accessing the byte as ads->common.bytes[3] as that
field is declared as being one byte.
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D53152
by removing the cast to _Bool. The _Bool type is not defined for C++,
and the specification from the gcc info doc states that the return
type of the __builtin_{add,sub,mul}_overflow() is bool already.
This is done instead of including stdbool.h to avoid namespace
pollution, since defining bool from stdckdint.h simingly is not
sanctioned by ISO/IEC 9899:2024.
PR: 290299
Reviewed by: des
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D53149
The pt hwt(4) backend uses NMIs to receive updates about the latest t
racing buffer offsets from the tracing hardware. However, it uses
taskqueue(9) to schedule the bottom-half handler. This can lead to
a panic since the taskqueue(9) code isn't aware it's being called
from an NMI context and uses the regular scheduling interfaces.
Fix this by scheduling the bottom-half handler using swi(9) and the
SWI_FROMNMI flag.
Fixes: 310162ea21
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52491
Using these targets on a pkgbase system will cause the installed system
to become out of sync with the package database, which is almost certain
to cause issues the next time pkg(8) is used.
To prevent users doing this accidentally, disallow install* if we detect
that FreeBSD-runtime is installed in the target. The check can be
overridden with DESTDIR=/ for users who are sure they want to do this.
MFC after: 3 days
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52879