socket_splice tests: Explicitly bind to the loopback address
Otherwise, when connecting to the value returned by getsockname(), we
inadvertently end up connecting to INADDR_ANY, which stopped working
after commit cd240957d7ba ("netinet: Disallow connections to
INADDR_ANY").
Fixes: cd240957d7ba ("netinet: Disallow connections to INADDR_ANY")
vfs_cache.c: Use CACHE_FPL_SUPPORTED_CN_FLAGS
Commit 2ec2ba7e232d added some code to cache_can_fplookup()
which worked (ensuring an abort when OPENNNAMED was set),
but showed I didn't understand what
CACHE_FPL_SUPPORTED_CN_FLAGS was used for.
This patch cleans it up.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50524
Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
vm_object: drop reverse walk from collect_flush
In vm_object_page_collect_flush, following a forward walk from page p
seeking more pages to which vm_object_page_remove_write might be
applied, a backward walk from page p is attempted. It never finds a
page, and so this change removes that walk, and renames the function
to better indicate its use for one specific application only.
It never finds a page because collect_flush() is only called from one
place, in vm_object_page_clean(). If there was a page p-1 to be found,
then either it is less than tstart, or it would have been found in the
previous iteration. If it less than tstart, then page_clean()
shouldn't be messing with it. If it was found in the previous
iteration, then vm_object_page_collect_flush() would have been called
in that iteration, and page p would have been the first page in the
forward walk from p-1, and it would have been processed then, and so p
would not be passed to vm_object_page_collect_flush now.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50517
vm_page: drop mpred from grab_valid_iter()
Variable mpred in vm_page_grab_valid_iter() has become a write-only
variable. Drop it.
In grab_valid_iter(), drop a pctrie_iter_reset() call already handled
in vm_page_alloc_iter().
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D50424
open.2: add a note about conversion of a file descriptor into O_PATH
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D50511
systat/top: Update ZFS sysctl names
Some of ARC statistic sysctls changed years ago, but those tools
are still using legacy shims, that are going to be removed.
MFC after: 3 days
net80211: remove direct references to ifp->if_xname
* change ieee80211_get_vap_ifname() to use if_name()
* migrate the other references of ifp->if_xname to
ieee80211_get_vap_ifname()
Differential Revision: https://reviews.freebsd.org/D50407
Reviewed by: bz
net80211: refactor out ifp->if_broadcastaddr into ieee80211_freebsd.c
* create ieee80211_vap_get_broadcast_address() to fetch the broadcast
MAC address for the given VAP
* refactor references to ifp->if_broadcastaddr ->
ieee80211_vap_get_broadcast_address()
Differential Revision: https://reviews.freebsd.org/D50406
Reviewed by: bz
net80211: migrate if_flags, if_drvflags out of most source files
Migrate both if_flags and if_drvflags out of most source files.
Ideally it'd only be referenced in ieee80211_freebsd.c, but for now
it also ignores references in ieee80211_ioctl.c.
* migrate if_flags set to if_setflags
* migrate if_flags get to if_getflags
* migrate if_drvflags get to if_getdrvflags
* add ieee80211_vap_ifp_check_is_monitor() and
ieee8021_vap_ifp_check_is_simplex() to abstract out the IFF_MONITOR
and IFF_SIMPLEX flag checks.
* add ieee80211_vap_ifp_check_is_running() and
ieee80211_vap_ifp_set_running_state() to represent what IFF_DRV_RUNNING
means (ie, mark the underlying OS network interface as active and
inactive.)
Notably this doesn't yet clear up OACTIVE; I need to better describe
that.
[3 lines not shown]
net80211: refactor the if_input call into ieee80211_vap_deliver_data()
Refactor the two places where NET_EPOCH_ENTER; if_input; NET_EPOCH_EXIT
are called into a single spot in ieee80211_freebsd.c.
This removes both if_input references and puts all the NET_EPOCH stuff
into ieee80211_freebsd.c.
Differential Revision: https://reviews.freebsd.org/D50404
Reviewed by: bz
net80211: move references to IF_LLADDR() into ieee80211_freebsd.c
* Move references to IF_LLADDR() into ieee80211_freebsd.c
* Add a comment on one that I need to verify before I move it
* Implement ieee80211_vap_sync_mac_address() which syncs the VAP
mac address from the network interface MAC address.
This uses FreeBSD-isms (network epoch, IF_LLADDR()) so it shouldn't
be in net80211 itself.
Differential Revision: https://reviews.freebsd.org/D50023
libc++: fix compiling <locale> with -fmodules
In /usr/include/c++/v1/__locale_dir/locale_base_api.h, xlocale.h is
included without first including stdio.h and stdlib.h, which causes
functions like strtoll_l() or sscanf_l() to not be declared.
When compiling with -fmodules, locale_base_api.h is processed separately
due to a declaration in /usr/include/c++/v1/module.modulemap, and this
will cause errors due to the above undeclared symbols.
Meanwhile, upstream has substantially reorganized this part of libc++'s
headers, so apply a minimalistic workaround: specifically when compiling
with -fmodules, add includes of stdio.h and stdlib.h.
PR: 286342
MFC after: 1 week
(cherry picked from commit c809b0184d0a6543bc5327d4252fa56a07ce4689)
libc++: fix compiling <locale> with -fmodules
In /usr/include/c++/v1/__locale_dir/locale_base_api.h, xlocale.h is
included without first including stdio.h and stdlib.h, which causes
functions like strtoll_l() or sscanf_l() to not be declared.
When compiling with -fmodules, locale_base_api.h is processed separately
due to a declaration in /usr/include/c++/v1/module.modulemap, and this
will cause errors due to the above undeclared symbols.
Meanwhile, upstream has substantially reorganized this part of libc++'s
headers, so apply a minimalistic workaround: specifically when compiling
with -fmodules, add includes of stdio.h and stdlib.h.
PR: 286342
MFC after: 1 week
(cherry picked from commit c809b0184d0a6543bc5327d4252fa56a07ce4689)
release: Avoid pipe in tarball creation
Previously errors from invoking tar for src.txz or ports.txz were eaten
by the pipeline. If something fails in creating these tarballs we want
the build to fail rather than producing subtly broken artifacts. Use
${TAR_XZ_CMD} to add -J to tar's commandline rather than | xz.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50459
bsd.own.mk: Introduce TAR_XZ_CMD
It is TAR_CMD with -J added, and can be used to avoid a tar | xz pipe
that could mask errors.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50473
nfs_clvnops.c: Add an initialization mistakenly removed
Commit e4c7b2b6053f mistakenly removed an initialization of "newvp",
which could result in crashes.
This patch puts the initialization back in.
Reported by: cy
Tested by: cy
Fixes: e4c7b2b6053f ("nfsv4: Add support to NFSv4 for named attributes")
ddb4: improve formatting
Improve the consistency of the formatting.
Reviewed by: ziaee
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50514
netinet: Disallow connections to INADDR_ANY
Previously connect() or sendto() to INADDR_ANY reached some socket bound
to some host interface address. Although this was intentional it was an
artifact of a different era, and is not desirable now.
In 417b35a97b76 markj added support to disallow connect() to INADDR_ANY.
Take the next logical step and disable it by default.
PR: 280705
Reviewed by: markj, jhb, zlei
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47740
m4: Fix OOB access displaying MIN_INT
Previously displaying INT_MIN resulted in an out of bounds access to
digits[-8]. In twos-complement -INT_MIN is still negative.
PR: 287013
Reviewed by: emaste
m4: Allow empty base argument in eval()
POSIX specifies "The second argument, if specified, shall set the radix
for the result; if the argument is blank or unspecified, the default
is 10." Previously we reported an invalid
PR: 287015
Reviewed by: emaste
elf.5: Document .init_array and .fini_array
And note that .init and .fini are legacy interfaces.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50380