OPNSense/src 7b78883sys/dev/virtio/p9fs virtio_p9fs.c

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
DeltaFile
+1-1sys/dev/virtio/p9fs/virtio_p9fs.c
+1-11 files

OPNSense/src 6afae81sys/fs/p9fs p9fs_vfsops.c

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
DeltaFile
+2-0sys/fs/p9fs/p9fs_vfsops.c
+2-01 files

OPNSense/src 7c075f7lib/libc/net linkaddr.c linkaddr.3, lib/libc/tests/net link_addr_test.cc

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]
DeltaFile
+132-66lib/libc/net/linkaddr.c
+151-1lib/libc/tests/net/link_addr_test.cc
+20-14lib/libc/net/linkaddr.3
+2-1sbin/ifconfig/af_link.c
+1-1sys/net/if_dl.h
+306-835 files

OPNSense/src 0279f4flib/libc/net linkaddr.c linkaddr.3, lib/libc/tests/net link_addr_test.cc

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)
DeltaFile
+86-26lib/libc/net/linkaddr.c
+111-0lib/libc/tests/net/link_addr_test.cc
+43-2lib/libc/net/linkaddr.3
+5-2lib/libc/net/Makefile.inc
+4-0lib/libc/net/Symbol.map
+1-0sys/net/if_dl.h
+250-306 files

OPNSense/src 6c6fed4lib/libc/tests/net link_addr_test.cc Makefile

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]
DeltaFile
+271-0lib/libc/tests/net/link_addr_test.cc
+3-0lib/libc/tests/net/Makefile
+274-02 files

OPNSense/src 9c52826sbin/ifconfig ifieee80211.c

Revert "ifconfig: 802.11: decode more information elements (IEs)"

This reverts commit f6ed22f5e21c25c4286a3287c8a969d93e711c5a.
DeltaFile
+3-226sbin/ifconfig/ifieee80211.c
+3-2261 files

OPNSense/src da18b3dsys/fs/p9fs p9fs_vfsops.c

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
DeltaFile
+2-0sys/fs/p9fs/p9fs_vfsops.c
+2-01 files

OPNSense/src 88c0983sys/dev/virtio/p9fs virtio_p9fs.c

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
DeltaFile
+1-1sys/dev/virtio/p9fs/virtio_p9fs.c
+1-11 files

OPNSense/src dc462fflib/libc/net linkaddr.c linkaddr.3, lib/libc/tests/net link_addr_test.cc

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]
DeltaFile
+132-66lib/libc/net/linkaddr.c
+151-1lib/libc/tests/net/link_addr_test.cc
+20-14lib/libc/net/linkaddr.3
+2-1sbin/ifconfig/af_link.c
+1-1sys/net/if_dl.h
+306-835 files

OPNSense/src 55788b7lib/libc/net linkaddr.c linkaddr.3, lib/libc/tests/net link_addr_test.cc

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)
DeltaFile
+86-26lib/libc/net/linkaddr.c
+111-0lib/libc/tests/net/link_addr_test.cc
+43-2lib/libc/net/linkaddr.3
+5-2lib/libc/net/Makefile.inc
+4-0lib/libc/net/Symbol.map
+1-0sys/net/if_dl.h
+250-306 files

OPNSense/src 9c3274blib/libc/tests/net link_addr_test.cc Makefile

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]
DeltaFile
+271-0lib/libc/tests/net/link_addr_test.cc
+3-0lib/libc/tests/net/Makefile
+274-02 files

OPNSense/src f6ed22fsbin/ifconfig ifieee80211.c

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)
DeltaFile
+226-3sbin/ifconfig/ifieee80211.c
+226-31 files

OPNSense/src 497e3b0sbin/ifconfig ifieee80211.c

ifconfig: 802.11: decode RSNXE IE

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D50675

(cherry picked from commit 1313f1c2a35f7dbaba1b2948d2f0c4a1f4113f67)
DeltaFile
+31-0sbin/ifconfig/ifieee80211.c
+31-01 files

OPNSense/src 02a1444sbin/ifconfig ifieee80211.c

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)
DeltaFile
+22-9sbin/ifconfig/ifieee80211.c
+22-91 files

OPNSense/src c7209c7sbin/ifconfig ifieee80211.c

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)
DeltaFile
+20-4sbin/ifconfig/ifieee80211.c
+20-41 files

OPNSense/src 9f19d34sbin/ifconfig ifieee80211.c

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)
DeltaFile
+6-0sbin/ifconfig/ifieee80211.c
+6-01 files

OPNSense/src ad624b1sbin/ifconfig ifieee80211.c

ifconfig: 802.11: fix a warning message

s/can/cannot/

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D50552

(cherry picked from commit 08471a76e3d27ffa9e2605dab0ff3c4968e7fef6)
DeltaFile
+1-1sbin/ifconfig/ifieee80211.c
+1-11 files

OPNSense/src 6cc4cfbsbin/ifconfig af_inet6.c, sbin/ifconfig/tests inet6.sh Makefile

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]
DeltaFile
+83-0sbin/ifconfig/tests/inet6.sh
+4-2sbin/ifconfig/tests/Makefile
+5-0sbin/ifconfig/af_inet6.c
+92-23 files

OPNSense/src 666599fsys/contrib/dev/mediatek/mt76 zzz_fw_ports_fwget.sh, usr.sbin/fwget/pci pci_network_mediatek

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)
DeltaFile
+8-6sys/contrib/dev/mediatek/mt76/zzz_fw_ports_fwget.sh
+5-1usr.sbin/fwget/pci/pci_network_mediatek
+13-72 files

OPNSense/src 110b00fsys/contrib/dev/rtw89 chan.c

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)
DeltaFile
+21-0sys/contrib/dev/rtw89/chan.c
+21-01 files

OPNSense/src 1e9db61sys/contrib/dev/iwlwifi iwl-drv.c

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)
DeltaFile
+3-0sys/contrib/dev/iwlwifi/iwl-drv.c
+3-01 files

OPNSense/src 56b1622sys/dev/ice ice_drv_info.h ice_devids.h

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)
DeltaFile
+10-15sys/dev/ice/ice_drv_info.h
+1-1sys/dev/ice/ice_devids.h
+11-162 files

OPNSense/src 219778asys/net if.c

ifnet: Fix a typo in a source code comment

- s/possiable/possible

MFC after:      3 days

(cherry picked from commit ad2d7e594f6d519be6e9674c8048a406a453fef9)
DeltaFile
+1-1sys/net/if.c
+1-11 files

OPNSense/src 4ad2d0esys/net if.c

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)
DeltaFile
+8-21sys/net/if.c
+8-211 files

OPNSense/src acc4d63sys/net if_bridge.c

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)
DeltaFile
+1-1sys/net/if_bridge.c
+1-11 files

OPNSense/src c10dad0sys/net if_bridge.c, tests/sys/net if_bridge_test.sh

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]
DeltaFile
+51-0tests/sys/net/if_bridge_test.sh
+10-13sys/net/if_bridge.c
+61-132 files

OPNSense/src c93e857sys/net if_bridge.c

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]
DeltaFile
+20-19sys/net/if_bridge.c
+20-191 files

OPNSense/src 175f99fsys/net if_bridgevar.h

net/if_bridgevar.h: add include guard

Reviewed by:    kp
Approved by:    des (mentor)

(cherry picked from commit f6aedb956ef154828c4bfaddaa5d5eb2dda5225c)
DeltaFile
+5-0sys/net/if_bridgevar.h
+5-01 files

OPNSense/src 754b659sys/net if_bridge.c ethernet.h

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)
DeltaFile
+16-12sys/net/if_bridge.c
+5-0sys/net/ethernet.h
+1-1sys/net/if_bridgevar.h
+22-133 files

OPNSense/src 80b01e1sys/net if_dl.h

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)
DeltaFile
+3-2sys/net/if_dl.h
+3-21 files