virtio_p9fs: Support attaching to pci and mmio
Some implementations of the virtio 9p transport are implemented on
virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver
attaches when this is the case.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D49600
p9fs: Call VN_LOCK_ASHARE on new vnodes
We set MNTK_LOOKUP_SHARED on p9fs mounts, but disable shared locking of
vnodes (i.e., LK_SHARED requests are automatically translated to
LK_EXCLUSIVE.
Reviewed by: kib
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50759
link_addr: be more strict about address formats
instead of accepting any character as a delimiter, only accept ':', '.'
and '-', and only permit a single delimiter in an address.
this prevents accepting bizarre addresses like:
ifconfig epair2a link 10.1.2.200/28
... which is particularly problematic on an INET6-only system, in which
case ifconfig defaults to the 'link' family, meaning that:
ifconfig epair2a 10.1.2.200/28
... changes the Ethernet address of the interface.
bump __FreeBSD_version so link_addr() consumers can detect the change.
Reviewed by: kp, des
[6 lines not shown]
libc: add link_ntoa_r()
this is a re-entrant version of link_ntoa. use an in-out parameter for
the buffer size, so the user requires at most two calls to determine the
needed size.
reimplement link_ntoa using link_ntoa_r with a static buffer.
Reviewed by: des
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50202
(cherry picked from commit da509c29089ab169b667ebdf82aa903987ba9c6d)
libc tests: add tests for link_addr(3) and link_ntoa(3)
for now, since link_addr() has no way to indicate an error, these are
only positive tests which check the outcome of valid inputs.
Reviewed by: ngie, des, adrian
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50062
(cherry picked from commit 757e973fb2112ea442aa8990d991f406d407b6f7)
link_addr_test: use <cstddef>, not <sys/stddef.h>
<cstddef> is the correct header; this fixes the GCC build.
while here, sort the headers.
Fixes: 757e973fb211 ("libc tests: add tests for link_addr(3) and link_ntoa(3)")
Reviewed by: des
[4 lines not shown]
p9fs: Call VN_LOCK_ASHARE on new vnodes
We set MNTK_LOOKUP_SHARED on p9fs mounts, but disable shared locking of
vnodes (i.e., LK_SHARED requests are automatically translated to
LK_EXCLUSIVE.
Reviewed by: kib
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50759
virtio_p9fs: Support attaching to pci and mmio
Some implementations of the virtio 9p transport are implemented on
virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver
attaches when this is the case.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D49600
link_addr: be more strict about address formats
instead of accepting any character as a delimiter, only accept ':', '.'
and '-', and only permit a single delimiter in an address.
this prevents accepting bizarre addresses like:
ifconfig epair2a link 10.1.2.200/28
... which is particularly problematic on an INET6-only system, in which
case ifconfig defaults to the 'link' family, meaning that:
ifconfig epair2a 10.1.2.200/28
... changes the Ethernet address of the interface.
bump __FreeBSD_version so link_addr() consumers can detect the change.
Reviewed by: kp, des
[6 lines not shown]
libc: add link_ntoa_r()
this is a re-entrant version of link_ntoa. use an in-out parameter for
the buffer size, so the user requires at most two calls to determine the
needed size.
reimplement link_ntoa using link_ntoa_r with a static buffer.
Reviewed by: des
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50202
(cherry picked from commit da509c29089ab169b667ebdf82aa903987ba9c6d)
libc tests: add tests for link_addr(3) and link_ntoa(3)
for now, since link_addr() has no way to indicate an error, these are
only positive tests which check the outcome of valid inputs.
Reviewed by: ngie, des, adrian
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50062
(cherry picked from commit 757e973fb2112ea442aa8990d991f406d407b6f7)
link_addr_test: use <cstddef>, not <sys/stddef.h>
<cstddef> is the correct header; this fixes the GCC build.
while here, sort the headers.
Fixes: 757e973fb211 ("libc tests: add tests for link_addr(3) and link_ntoa(3)")
Reviewed by: des
[4 lines not shown]
ifconfig: 802.11: decode more information elements (IEs)
Start dealing with Element ID Extension present (IE T=255) and start
parsing elemants from the Element ID Extension set.
Namely (partially) decode HE_CAPA, HE_OPER, MU_EDCA_PARAM_SET,
and as well as SUP_OP_CLASS.
For length reasons also rename UNKNOWN_ELEMID_%d to ELEMID_%d.
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50678
(cherry picked from commit a2a15732eb1db4616aa628ae8bfd4047c40dbaee)
ifconfig: 802.11: factor out keyix printing
The node unicast key (PTK) uses a key index of (-1) and printing
a 64k number does not look great. Factor out printing the key
number into a buffer and use 'ucast' for the node unicast key.
Hope is that this will be useful for the future as well when we
will have more/different keys possibly.
Looks like (with -vk):
AES-CCM 2:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
AES-CCM 3:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
AES-GCM ucast:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 tx+rx
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50555
(cherry picked from commit 164bf9ffbe1a9fc8768b2f597fd4b32b3e406ac1)
ifconfig: 802.11: print node unicast key (PTK) if available in STA mode
Add a variable when querying the BSSID so we can later use it rather
than losing the "data" buffer.
When printing key information also query the node unicast key if in
STA mode (the key for the BSSID). Do not error in case we fail.
This is helpful for debugging mostly; was also useful when testing
GCMP support.
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50554
(cherry picked from commit e277735ce05911aaee336cd61ec3a12435f46d8d)
ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information
While we currently do not print the STA unicast key (PTK) we will not
see this but it is for fullness and in preparations for follow-up
hanges.
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50553
(cherry picked from commit 54ad06cad10c3822784389b0956f92a1c7041abd)
ifconfig: reject netmask and broadcast for inet6
We don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig. Handle this the
same way as af_link, by rejecting attempts to configure these
parameters.
PR: 286910
Reported by: Hayzam Sherif <hayzam at alchemilla.io>
MFC after: 3 days
Reviewed by: zlei, kevans, des, cy
Approved by: kevans (mentor)
Differential Revision: https://reviews.freebsd.org/D50413
(cherry picked from commit 59ee9260e6bbcc3b5654126eed6e9490315c81f1)
ifconfig tests: remove incorrect #!
Fixes: 59ee9260e6bb ("ifconfig: reject netmask and broadcast for inet6")
[5 lines not shown]
fwget / mt76: update script to extra firmware and update fget(8)
Update the script to support all the sub-drivers we compile now.
Some minor polishing as well.
Update fwget(8) as more IDs were added.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 91f53f4e062715d869f2cb7e957707255390b704)
rtw89: prevent a NULL pointer deref in rtw89_swap_chanctx()
It is currently unclear if this is a result of the driver itself already
or the way LinuxKPI drives channels and the driver simply accepting and
acting on things it no longer should.
For now put the bandaid into place to make the driver work and pass
packets. For better resilience the check does not hurt anyway.
The moment we enter rtw89_chanctx_ops_add() the first time,
entity_map 0x00000001 has the lowest bit set and find_next_zero_bit()
will return 1. As a result the driver will try to swap chanctxs and
trip over a NULL pointer in rtw89_swap_chanctx(). See comment there
for how to (likely) trigger it.
Sponsored by: The FreeBSD Foundation
Reported by: Axel Rau (Axel.Rau Chaos1.DE) with 8852CE
(cherry picked from commit 3a427b8320840f1e69779efeccc5898eb2972030)
iwlwifi: add message how to install firmware on FreeBSD
While it is too late for 14.3-R point people at fwget(8) to install
firmware if the driver cannot find any.
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste, ziaee
Differential Revision: https://reviews.freebsd.org/D50777
(cherry picked from commit 8ac82ba19efbaeec065621215c3843f054fa419e)
ice(4): Update E830-XXV device ids
Device ID for E830-XXV adapters was changed from 12D3
to 12DE. Update driver accordingly and bump version
number.
Also remove subdevice id for E830-XXV-4 for OCP 3.0,
which was cancelled.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Approved by: kbowling (mentor), erj (mentor)
Tested by: Gowthamkumar K S <gowtham.kumar.ks at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D50327
(cherry picked from commit 0fed8828c95a9d2cbcb43147ff851ca6f2c21d0f)
ifnet: Integrate if_unroute() into if_down()
if_unroute() is static since 2004 and is not used anywhere except for
if_down().
This also makes it easier to grep by the pattern `if_flags &= ~IFF_UP`.
No functional change intended.
Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D49356
(cherry picked from commit 0693c3f7cb3d9e5389863a0c131ddef799c77091)
bridge: define VLANTAGOF correctly
to avoid strange precedence errors, enclose the macro body in
parentheses. this fixes constructs like: if (VLANTAGOF(m) == i)
Reviewed by: kp
(cherry picked from commit f36292f010fcc6391605182f2973fdc12a3bd15f)
bridge: fix vlan(4) on a bridge member
If an interface is a bridge member, and a vlan(4) is also created on
that interface, and net.link.bridge.member_ifaddrs=0, then vlan(4)
will never see any incoming frames because bridge doesn't pass them
to the host for processing.
Work around this by checking for locally-addressed frames using the
MAC address of the interface we received the frame on, but only if
the frame has a .1q tag and there's a vlan trunk on the interface.
This behaviour is almost certainly "wrong" and it's not clear if we
really want to support this, but it did work in the past and the
member_ifaddrs change was not supposed to break it, so this restores
the previous behaviour.
PR: 287150
MFC after: 1 week
Reviewed by: kevans, des
[4 lines not shown]
bridge: check allow_llz_overlap before member_ifaddrs
When adding a new interface to a bridge and allow_llz_overlap=0, which
is the default value, if_bridge checks if the interface has IPv6 link
local addresses assigned, and if it does, it calls in6_ifdetach() to
remove all IPv6 addresses from the interface.
This means it was possible to do this:
% ifconfig bridge1 create inet6 -ifdisabled auto_linklocal up
% ifconfig epair20 create inet6 -ifdisabled auto_linklocal up
% ifconfig bridge1 addm epair20a
... with the result that the link-local address on epair20a would be
removed, then the interface would be added to the bridge.
If member_ifaddrs=0, which is also the default value, this no longer
works:
[17 lines not shown]
sys/net: add a new ether_vlanid_t type
ether_vlanid_t is a type to represent a VLAN ID, for example inside a
.1q tag. since this is specific to Ethernet, put it in net/ethernet.h.
change bridge to use the new type instead of uint{16,32}_t.
Reviewed by: adrian, kp
Differential Revision: https://reviews.freebsd.org/D49836
(cherry picked from commit 96f830456fd449c4cb5a7df8a2f6c3c96993b43e)
net/if_dl.h: add param names in prototypes
previously these _KERNEL functions were inconsistent, with some having
parameter names and some not. fix this by giving them all names, per
style(9).
Reviewed by: thj, des
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50219
(cherry picked from commit 8c7d193e3cbe3d1c9a7f7869f1748bebefabaccf)