ipfw: fix order of memcpy arguments.
This fixes `ipfw table N lookup addr` command for MAC tables.
(cherry picked from commit e012d79c9c732a6aef21066feba2e5e48833cca4)
ipsec: fix IPv6 over IPv4 tunneling.
Properly initialize setdf variable in ipsec_encap().
It is used for AF_INET6 case when IPv6 datagram is going to be
encapsulated into IPv4 datagram.
PR: 282535
Fixes: 4046178557e1
(cherry picked from commit c94d6389e428fac55946bfcdbbc3162c06a9278e)
ipfw: fix order of memcpy arguments.
This fixes `ipfw table N lookup addr` command for MAC tables.
(cherry picked from commit e012d79c9c732a6aef21066feba2e5e48833cca4)
sfxge: defer ether_ifattach to when ifmedia_init is done
Otherwise the ifmedia subsystem may call unguarded NULL function
pointers. Same issue that was fixed for cxgb(4) in f2daf8995.
Also see: https://github.com/opnsense/src/issues/228
MFC after: 1 week
lib/libsbuf/tests: reformat with `clang-format`
This change is being done first so any functional changes from the tests
will be clearer to reviewers.
No functional change intended.
MFC after: 2 weeks
Ref: https://reviews.freebsd.org/D47826
contrib/wpa: pass IFM_IEEE80211_VHT5G if vht_enabled on the channel
Set media mode correctly to IFM_IEEE80211_VHT5G if vht_enabled is set
on the channel. Otherwise we'll end up setting 11NA.
Not a problem on first sight given net80211 does the upgrade to VHT
for us. But we would not set iv_des_mode ("desired mode") on the vap.
Setting this will put a contraint on/help scanning for our desired
(VHT) channels to my understanding of the code.
Sponsored by: The FreeBSD Foundation
MFC after: 6 weeks
Reviewed by: cy, adrian
Differential Revision: https://reviews.freebsd.org/D35978
net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage
if STBC will be allowed for VHT RX/TX.
For RX this will only allow us to turn it off but no fine grained
control of the number of supported spatial streams.
Introduce IEEE80211_FVHT_CHANWIDTH_MASK as a helper to make the
spelling out of the IEEE80211_FVHT_MASK more readable.
Update ifconfig to allow setting of these flags.
Sponsored by: The FreeBSD Foundation
MFC atfer: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D47838
net80211: name IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_{NONE -> NO160}
IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE is confusing as the field does
indicate that the STA does not support 160 (or 80+80) Mhz.
[802.11ac: Table 8-183v-Subfields of the VHT Capabilities Info field]
All the other bits are related to the support of 160Mhz so make it
clear that it does not mean that we do not support any VHT CHAN WIDTH
but merely do not support the optional 160/80+80.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D47837
comsat: Use initgroups and setgid not just setuid
PR: 270404
Reviewed by: jlduran
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47828
net80211: add missing reference for struct ieee80211_vht_mcs_info
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47836
LinuxKPI: 802.11: make HT compile again
Bring in changes missed during the last driver updates to make HT
compile when enabled.
Sponsored by: The FreeBSD Foundation
Fixes: 7b43f4d064195
MFC after: 3 days
LinuxKPI: firmware: change order filenames trying to load firmware
Given we have the support in main and stable/14 to load plain firmware
files from /boot/firmware/ make use of that. Switch the order to
try the original unmangled filename and path first before trying any
replacements.
This reduces time and console noise (especially under bootverbose).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D47682
pw: tests: add a test for -M with a pre-existing home directory
Previous versions of pw(8) wouldn't chmod the home directory if it
already existed prior to user creation, rendering adduser(8) -M
ineffective in some cases. Add a test to cover that situation.
PR: 280099
Reviewed by: kevans
pw: set the user's home directory mode if it existed
The adduser(8) prompt allows one to set the mode of a new home
directory, but pw(8) doesn't honor the -M mode if the home directory
already exists at creation time. It doesn't seem to make sense to
ignore the mode (which may lead to a security issue on the system being
configured) when we'll happily chown an existing directory, so fix the
inconsistency.
PR: 280099
Reviewed by: des, jlduran (previous version)
Differential Revision: https://reviews.freebsd.org/D46443
Expose POSIX functions incorporated into C23
C23 has incoporated a small number of POSIX functions, so these
should be exposed for C23, regardless of POSIX.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D47856
ota: Merge 20240728 (bsd-feature) from ota 3319c34a8713
Jul 28, 2024
Fixed readcsvrec resize segfault when reading csv records longer
than 8k. Thanks to Ozan Yigit.
mktime() added to bsd-features branch. Thanks to Todd Miller.
(cherry picked from commit 8d457988a72487b35ee3922671775d73169339e3)
ota: Merge 20240623 (bsd-features) from ota 9f971fba471b
Merge from upstream. The system-status test was modifed upstream, but it
still doesn't fit into ATF, so those changes weren't brought in.
From FIXES:
Jun 23, 2024
Fix signal for system-status test. Thanks to Tim van der Molen.
Rewrite if-else chain as switch. Thanks to Andrew Sukach.
May 27, 2024
Spelling fixes and removal of unneeded prototypes and extern.
Thanks to Jonathan Gray.
May 4, 2024
Fixed a use-after-free bug with ARGV for "delete ARGV".
Also ENVtab is no longer global. Thanks to Benjamin Sturz
for spotting the ARGV issue and Todd Miller for the fix.
[7 lines not shown]
libzpool: add workaround for MIPS-specific llvm bug compiling arc.c
This works around an assertion in llvm's shrink wrapping analysis pass,
when compiling arc.c for mips and mips64:
Assertion failed: (PhysReg.isPhysical() && "Unallocated register?!"), function useOrDefCSROrFI, file /usr/src/contrib/llvm-project/llvm/lib/CodeGen/ShrinkWrap.cpp, line 341.
The bug will also be submitted upstream.
Direct commit to stable/13, since MIPS support was removed in 14.0.
Fix buildworld with gcc 12 after llvm-19 import
Unfortunately gcc 12's is not yet capable of compiling all of libc++
19's C++23 code, which results in errors similar to:
/usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function
41 | operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) {
| ^~~~~~~~
/usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function
48 | operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) {
| ^~~~~~~~
Until we can get rid of gcc 12, work around this by making it compile
libc++ in C++20 mode instead.
NOTE: The resulting libc++ library will not be C++23 compatible! Please
try to avoid shipping it, and use gcc 13 instead, if you must use gcc.
PR: 280562
[3 lines not shown]
Apply workaround for building llvm-project with WITHOUT_LLVM_ASSERTIONS
Some internal checking functions should only be declared when both
NDEBUG and LLVM_ENABLE_ABI_BREAKING_CHECKS are undefined, otherwise you
would get compile errors similar to:
/usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:921:13: error: no member named 'VerifyDAGDivergence' in 'llvm::SelectionDAG'
921 | CurDAG->VerifyDAGDivergence();
| ~~~~~~ ^
Adjust the conditions for declaring and using these functions. This has
also been reported upstream.
Reported by: cy
PR: 280562
MFC after: 1 month
(cherry picked from commit a5b1eecbed07519c637095e3291b9cbd9748e823)
Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG
When assertions are disabled, the upstream build system disables
LLVM_ENABLE_ABI_BREAKING_CHECKS by default. Though the upstream build
system allows it to be force-enabled, it looks like that is not a
well-tested build-time configuration.
Therefore, always disable LLVM_ENABLE_ABI_BREAKING_CHECKS when
assertions are disabled, which will also save some more runtime cost
when people use WITHOUT_LLVM_ASSERTIONS.
PR: 280562
MFC after: 1 month
(cherry picked from commit 1c83996beda7b6a382857c318f46daefcb6bd84c)