FreeBSD/src 097458ausr.sbin/freebsd-update freebsd-update.sh

freebsd-update: Error for -b basedir without UNAME_r set

freebsd-update sets the currently running release from UNAME -r, which
can be overridden via the --currently-running commandline option (or by
setting UNAME_r in the environment).  This may be invalid if -b is used
to specify a basedir other than /, so error out if -b is specified
without setting the currently running version.

PR:             283229
Reviewed by:    cperciva
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48016
DeltaFile
+4-0usr.sbin/freebsd-update/freebsd-update.sh
+4-01 files

FreeBSD/src ddfe98esys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Allow tapping the TX packets

Currently only the packets in the RX path can be captured by tcpdump
as the ETHER_BPF_MTAP call in the TX path is missing. Add it so that
packets in both directions can be captured.

PR:             290973
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54891

(cherry picked from commit 968647502ec21464ad3aecc7577ff0e8dfd41693)
(cherry picked from commit 425b9cec0b8ce15a6e67d54a73f4f38dc66a4ccc)
DeltaFile
+1-0sys/dev/qlnx/qlnxe/qlnx_os.c
+1-01 files

FreeBSD/src 87942d7sys/dev/qlnx/qlnxe qlnx_os.c ecore_l2.c

qlnxe: Overhaul setting the multicast MAC filters

When operating the multicast MAC filters, the current usage of
ECORE_FILTER_ADD and ECORE_FILTER_REMOVE are rather misleading.
ECORE_FILTER_ADD reads "adding new filter", but it actually removes
any existing filters and then addes a new one. ECORE_FILTER_REMOVE
reads "removing a filter", but it actually removes all filters.
Let's use ECORE_FILTER_REPLACE and ECORE_FILTER_FLUSH instead to
avoid confusion.

In the current implementation, only one MAC address is passed to
ecore_sp_eth_filter_mcast() and any previously installed filters are
removed, hence it breaks the multicast function. That can be observed
via either assigning new IPv6 addresses to the interface or putting
the interface as a member of lagg(4) interface with LACP aggregation
protocol. Fix that by calculating the multicast filter bins directly
from multicast MAC addresses and replace the filters every time
the bins changes.


    [21 lines not shown]
DeltaFile
+37-153sys/dev/qlnx/qlnxe/qlnx_os.c
+21-20sys/dev/qlnx/qlnxe/ecore_l2.c
+3-8sys/dev/qlnx/qlnxe/ecore_vf.c
+4-5sys/dev/qlnx/qlnxe/ecore_l2_api.h
+1-4sys/dev/qlnx/qlnxe/qlnx_def.h
+66-1905 files

FreeBSD/src ee64955sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Avoid reinitializing the interface when it is already initialized

qlnx_init_locked() unconditionally uninitialize the interface thus is
actually reinitializing the interface. Well the init routine qlnx_init()
is to initialize the interface by net stack when assigned with the first
inet or inet6 address. The ioctl SIOCSIFADDR for the first inet6 address
is handled by ether_ioctl() thus the interface is reinitialized no matter
it was initialized or not.

Add a driver status check for that to avoid reinitializing. Further plan
is removing SIOCSIFADDR ioctl from the driver and let ether_ioctl() handle
it.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54887

(cherry picked from commit c10e6bc0f0079e90cb484323ad71d437f1882422)
(cherry picked from commit 8731ff4871d5397bae65bf184c44629a52c0e97b)
DeltaFile
+2-1sys/dev/qlnx/qlnxe/qlnx_os.c
+2-11 files

FreeBSD/src e1a051fsys/modules/qlnx/qlnxev Makefile

qlnxev: Remove now unneeded include for opt_inet.h

Since the change [1], this is not required anymore.

This change partially reverts commit 8a847947153e.

[1] 4012b63889e4 qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54889

(cherry picked from commit ec7950fe42344900567cb72c83845ea4dc5a7114)
(cherry picked from commit 926e44b4983408dd8a4f5d7eb695de75b373548d)
DeltaFile
+0-1sys/modules/qlnx/qlnxev/Makefile
+0-11 files

FreeBSD/src 00ab0dfsys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

qlnxe: Refactor setting the promiscuous and allmulti mode

There are two entry points to set the promiscuous and allmulti mode.
One is ioctl, and another is the init routine. Given they share almost
the identical logic, refactor a little to make the code more clear.

While here, for the ioctl, translate the error to EINVAL to avoid
confusing the net stack.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54890

(cherry picked from commit 45b1718fadae7d56051ba04ef9d7a175a602a226)
(cherry picked from commit b8d2c1c367465506b66a1696483caec1d04b2ea0)
DeltaFile
+38-46sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+38-472 files

FreeBSD/src 20ffe22sys/dev/qlnx/qlnxe qlnx_os.c, sys/modules/qlnx/qlnxe Makefile

qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Since the change [1], the init routine qlnx_init() works as intended.
Let ether_ioctl() handle SIOCSIFADDR to simplify the code.

Combined with the change [1], this shall be a better fix for PR 287445.

[1] c10e6bc0f007 qlnxe: Avoid reinitializing the interface when it is already initialized

PR:             287445
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54888

(cherry picked from commit 4012b63889e40bb877bc0e4c8da1792bce472c08)
(cherry picked from commit 0f383f74b7398161c12a290e50b060baf45d2800)
DeltaFile
+0-25sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/modules/qlnx/qlnxe/Makefile
+0-262 files

FreeBSD/src ea1143bsys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

qlnxe: Avoid memcpy with same source and destination

In case the device is VF, qlnx_get_mac_addr() returns ha->primary_mac
hence it ends up memcpy with same source and destination. Refactor
slightly to avoid that.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54884

(cherry picked from commit 3aeeedc7e0dc231c16406ff64f4a08a716964c40)
(cherry picked from commit 6462189595047800337aaf052e397d1aade3f9a7)
DeltaFile
+7-6sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+7-72 files

FreeBSD/src 7d7cee0sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Remove a pointless copy back from the link-layer address

On ifnet attaching, ether_ifattach() makes the link-layer address by
shadow copying the ha->primary_mac. Well, the link-layer address will
not be altered during attaching, thus it is pointless to copy it back.

No functional change intended.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54883

(cherry picked from commit 4ac3081b282800158df7abe93f307d76e1b5b808)
(cherry picked from commit 23ffd1650cc431e762387d384ede99ae085bc130)
DeltaFile
+0-2sys/dev/qlnx/qlnxe/qlnx_os.c
+0-21 files

FreeBSD/src 6e5b12asys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Prevent potential concurrency between ioctls

The driver-managed status flags should be lock protected to be touched.
Also this can serialize ioctls those check the IFF_DRV_RUNNING status.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54886

(cherry picked from commit 0df8a998a9fe28af659cb401c537c6d785e55f81)
(cherry picked from commit 285b25c080faf71c60de36e834ef31cf70e6b50d)
DeltaFile
+9-8sys/dev/qlnx/qlnxe/qlnx_os.c
+9-81 files

FreeBSD/src 93719f8sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Fix setting the unicast MAC filter of RX path

When an Ethernet interface is added to lagg(4) as a child interface, its
type, aka if_type, is changed from IFT_ETHER to IFT_IEEE8023ADLAG. Well
changing the link-layer address of the lagg(4) interface will be
propagated to all child interfaces, hence the drivers of child interfaces
shall not presume the type of the interface will not be changed.

Meanwhile, on initializing, an ifnet has been fully attached and it is
guaranteed to have non-null link-layer address so stop NULL checking for
it.

Reviewed by:    kbowling
Fixes:          792226e53023 qlnxe: Allow MAC address override
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54885

(cherry picked from commit f250852c9a0c1021c3be4b498e27cfc7b42a81db)
(cherry picked from commit 6d138e958ffb318595eec29b910cada414e2f86d)
DeltaFile
+3-13sys/dev/qlnx/qlnxe/qlnx_os.c
+3-131 files

FreeBSD/src 0233e3fsys/net if_lagg.c

lagg: Remove the member pr_num from struct lagg_proto

It is set but never used. Remove it to avoid confusion and save a
little space.

While here, use designated initializers to initialize the LAGG protocol
table. That improves readability, and it will be safer to initialize the
table if we introduce new protocols in the future.

No functional change intended.

Reviewed by:    glebius
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55124

(cherry picked from commit 5ba503fc2cabc1a614997f102ace671d996bcc53)
DeltaFile
+6-13sys/net/if_lagg.c
+6-131 files

FreeBSD/src b8d2c1csys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

qlnxe: Refactor setting the promiscuous and allmulti mode

There are two entry points to set the promiscuous and allmulti mode.
One is ioctl, and another is the init routine. Given they share almost
the identical logic, refactor a little to make the code more clear.

While here, for the ioctl, translate the error to EINVAL to avoid
confusing the net stack.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54890

(cherry picked from commit 45b1718fadae7d56051ba04ef9d7a175a602a226)
DeltaFile
+38-46sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+38-472 files

FreeBSD/src 18c70c7sys/net if_lagg.c

lagg: Make the none protocol a first-class citizen

All the other protocols have corresponding start and input routines,
which are used in the fast path. Currently the none protocol is
treated specially. In the fast path it is checked to indicate whether
a working protocol is configured. There are two issues raised by this
design:

1. In production, other protocols are commonly used, but not the
none protocol. It smells like an overkill to always check it in the
fast path. It is unfair to other commonly used protocols.

2. PR 289017 reveals that there's a small window between checking the
protocol and calling lagg_proto_start(). lagg_proto_start() is possible
to see the none protocol and do NULL deferencing.

Fix them by making the none protocol a first-class citizen so that it
has start and input routines just the same as other protocols. Then we
can stop checking it in the fast path, since lagg_proto_start() and

    [15 lines not shown]
DeltaFile
+33-9sys/net/if_lagg.c
+33-91 files

FreeBSD/src 0cfc114sys/dev/qlnx/qlnxe qlnx_os.c ecore_l2.c

qlnxe: Overhaul setting the multicast MAC filters

When operating the multicast MAC filters, the current usage of
ECORE_FILTER_ADD and ECORE_FILTER_REMOVE are rather misleading.
ECORE_FILTER_ADD reads "adding new filter", but it actually removes
any existing filters and then addes a new one. ECORE_FILTER_REMOVE
reads "removing a filter", but it actually removes all filters.
Let's use ECORE_FILTER_REPLACE and ECORE_FILTER_FLUSH instead to
avoid confusion.

In the current implementation, only one MAC address is passed to
ecore_sp_eth_filter_mcast() and any previously installed filters are
removed, hence it breaks the multicast function. That can be observed
via either assigning new IPv6 addresses to the interface or putting
the interface as a member of lagg(4) interface with LACP aggregation
protocol. Fix that by calculating the multicast filter bins directly
from multicast MAC addresses and replace the filters every time
the bins changes.


    [20 lines not shown]
DeltaFile
+37-153sys/dev/qlnx/qlnxe/qlnx_os.c
+21-20sys/dev/qlnx/qlnxe/ecore_l2.c
+3-8sys/dev/qlnx/qlnxe/ecore_vf.c
+4-5sys/dev/qlnx/qlnxe/ecore_l2_api.h
+1-4sys/dev/qlnx/qlnxe/qlnx_def.h
+66-1905 files

FreeBSD/src 425b9cesys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Allow tapping the TX packets

Currently only the packets in the RX path can be captured by tcpdump
as the ETHER_BPF_MTAP call in the TX path is missing. Add it so that
packets in both directions can be captured.

PR:             290973
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54891

(cherry picked from commit 968647502ec21464ad3aecc7577ff0e8dfd41693)
DeltaFile
+1-0sys/dev/qlnx/qlnxe/qlnx_os.c
+1-01 files

FreeBSD/src 0f383f7sys/dev/qlnx/qlnxe qlnx_os.c, sys/modules/qlnx/qlnxe Makefile

qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Since the change [1], the init routine qlnx_init() works as intended.
Let ether_ioctl() handle SIOCSIFADDR to simplify the code.

Combined with the change [1], this shall be a better fix for PR 287445.

[1] c10e6bc0f007 qlnxe: Avoid reinitializing the interface when it is already initialized

PR:             287445
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54888

(cherry picked from commit 4012b63889e40bb877bc0e4c8da1792bce472c08)
DeltaFile
+0-25sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/modules/qlnx/qlnxe/Makefile
+0-262 files

FreeBSD/src 8731ff4sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Avoid reinitializing the interface when it is already initialized

qlnx_init_locked() unconditionally uninitialize the interface thus is
actually reinitializing the interface. Well the init routine qlnx_init()
is to initialize the interface by net stack when assigned with the first
inet or inet6 address. The ioctl SIOCSIFADDR for the first inet6 address
is handled by ether_ioctl() thus the interface is reinitialized no matter
it was initialized or not.

Add a driver status check for that to avoid reinitializing. Further plan
is removing SIOCSIFADDR ioctl from the driver and let ether_ioctl() handle
it.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54887

(cherry picked from commit c10e6bc0f0079e90cb484323ad71d437f1882422)
DeltaFile
+2-1sys/dev/qlnx/qlnxe/qlnx_os.c
+2-11 files

FreeBSD/src 926e44bsys/modules/qlnx/qlnxev Makefile

qlnxev: Remove now unneeded include for opt_inet.h

Since the change [1], this is not required anymore.

This change partially reverts commit 8a847947153e.

[1] 4012b63889e4 qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54889

(cherry picked from commit ec7950fe42344900567cb72c83845ea4dc5a7114)
DeltaFile
+0-1sys/modules/qlnx/qlnxev/Makefile
+0-11 files

FreeBSD/src 285b25csys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Prevent potential concurrency between ioctls

The driver-managed status flags should be lock protected to be touched.
Also this can serialize ioctls those check the IFF_DRV_RUNNING status.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54886

(cherry picked from commit 0df8a998a9fe28af659cb401c537c6d785e55f81)
DeltaFile
+9-8sys/dev/qlnx/qlnxe/qlnx_os.c
+9-81 files

FreeBSD/src 6462189sys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

qlnxe: Avoid memcpy with same source and destination

In case the device is VF, qlnx_get_mac_addr() returns ha->primary_mac
hence it ends up memcpy with same source and destination. Refactor
slightly to avoid that.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54884

(cherry picked from commit 3aeeedc7e0dc231c16406ff64f4a08a716964c40)
DeltaFile
+7-6sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+7-72 files

FreeBSD/src 23ffd16sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Remove a pointless copy back from the link-layer address

On ifnet attaching, ether_ifattach() makes the link-layer address by
shadow copying the ha->primary_mac. Well, the link-layer address will
not be altered during attaching, thus it is pointless to copy it back.

No functional change intended.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54883

(cherry picked from commit 4ac3081b282800158df7abe93f307d76e1b5b808)
DeltaFile
+0-2sys/dev/qlnx/qlnxe/qlnx_os.c
+0-21 files

FreeBSD/src 6d138e9sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Fix setting the unicast MAC filter of RX path

When an Ethernet interface is added to lagg(4) as a child interface, its
type, aka if_type, is changed from IFT_ETHER to IFT_IEEE8023ADLAG. Well
changing the link-layer address of the lagg(4) interface will be
propagated to all child interfaces, hence the drivers of child interfaces
shall not presume the type of the interface will not be changed.

Meanwhile, on initializing, an ifnet has been fully attached and it is
guaranteed to have non-null link-layer address so stop NULL checking for
it.

Reviewed by:    kbowling
Fixes:          792226e53023 qlnxe: Allow MAC address override
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54885

(cherry picked from commit f250852c9a0c1021c3be4b498e27cfc7b42a81db)
DeltaFile
+3-13sys/dev/qlnx/qlnxe/qlnx_os.c
+3-131 files

FreeBSD/src 4d3b126release/scripts pkg-stage.sh

release: Turn off debugging in pkg(8)

Running `pkg -d` in pkg-stage.sh results in multiple GB of network
traffic being written into the log files, which is less than helpful
when it comes to tracking down build failures.  Remove the -d flag.

MFC after:      5 days
X-MFC-note:     The code in 15 has diverged from 14, but the flag is
                there, just in a different place.

(cherry picked from commit 18721be356043f6749a6e2470bc9f7351c450c6e)
DeltaFile
+1-1release/scripts/pkg-stage.sh
+1-11 files

FreeBSD/src 721dfa7release/scripts pkg-stage.sh

release: Turn off debugging in pkg(8)

Running `pkg -d` in pkg-stage.sh results in multiple GB of network
traffic being written into the log files, which is less than helpful
when it comes to tracking down build failures.  Remove the -d flag.

MFC after:      5 days
X-MFC-note:     The code in 15 has diverged from 14, but the flag is
                there, just in a different place.

(cherry picked from commit 18721be356043f6749a6e2470bc9f7351c450c6e)
DeltaFile
+1-1release/scripts/pkg-stage.sh
+1-11 files

FreeBSD/src 4690a36contrib/blocklist/bin blacklistd.c run.c, contrib/blocklist/port popenve.c

Adapt changes from blocklist 2026-02-07 (10a907f)

Also apply the fix from PR 258411.

This is a direct commit to stable/14, as blacklist has been renamed to
blocklist upstream.

Approved by:    re (cperciva)

(cherry picked from commit 30c04399f2e81b8e71045fc410837461abeb2d8b)
DeltaFile
+37-34contrib/blocklist/port/popenve.c
+15-14contrib/blocklist/bin/blacklistd.c
+7-6contrib/blocklist/bin/run.c
+2-2contrib/blocklist/bin/blacklistd.conf.5
+0-1contrib/blocklist/bin/support.c
+61-575 files

FreeBSD/src 3c10ed2usr.bin/diff diffreg.c

diff: Report I/O errors in Stone algorithm

In the legacy Stone algorithm, we do a first pass over the files to
check if they're identical before we start diffing them.  That code
would correctly set the exit status if an I/O error was encountered,
but would not emit an error message.  Do so.

Approved by:    re (cperciva)
PR:             292198
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj
Differential Revision:  https://reviews.freebsd.org/D55125

(cherry picked from commit f8c12e6e3874cdd353fb16785da6f4e7eb134cd9)
(cherry picked from commit 37ceb8794c22d88a41e261d23d347bc7ac08b2c8)
DeltaFile
+7-3usr.bin/diff/diffreg.c
+7-31 files

FreeBSD/src 7cf7c71usr.bin/diff/tests diff_test.sh

diff: Correctly declare tests

Approved by:    re (cperciva)
Sponsored by:   Klara, Inc.
Fixes:          5fc739eb5949 ("diff: Fix integer overflows in Stone algorithm")
Fixes:          270492602b9b ("diff: Add test case for pagination resource leak")
Fixes:          590126789c84 ("diff: Don't compare a file or directory to itself")

(cherry picked from commit 157d6664aeb815db3b758bd3038fd1512a0f4e2c)
(cherry picked from commit b8bcf04d6dd37308834ee258230082ae6875b1f3)
DeltaFile
+4-1usr.bin/diff/tests/diff_test.sh
+4-11 files

FreeBSD/src b413914usr.bin/diff diffdir.c diffreg.c, usr.bin/diff/tests diff_test.sh

diff: Don't compare a file or directory to itself

While here, stop abusing struct dirent for something we don't even need
to store.

Approved by:    re (cperciva)
PR:             254455
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55113

(cherry picked from commit 590126789c841d80655869bc075c8980c173dd1c)

diff: Fix build

rc must be defined first.

Fixes:          590126789c84

    [5 lines not shown]
DeltaFile
+19-0usr.bin/diff/tests/diff_test.sh
+8-8usr.bin/diff/diffdir.c
+3-0usr.bin/diff/diffreg.c
+30-83 files

FreeBSD/src 6761e55usr.bin/diff pr.c pr.h, usr.bin/diff/tests diff_test.sh

diff: Fix pagination leak

* Drop an unnecessary variable and rename pidfd to procd.

* Rewinding stdout serves no purpose, so stop doing it.

* Don't bother freeing memory or setting the global status right
  before erroring out.

* Error out if dup(2) or dup2(2) fail.

* In the unlikely case that our pipe is equal to stdout, we need to
  record that information so we don't close it when cleaning up.

* Don't bother closing a descriptor before dup2(2)ing to it.

* Don't forget to close the the process descriptor after reaping the
  child process.


    [9 lines not shown]
DeltaFile
+10-12usr.bin/diff/pr.c
+1-0usr.bin/diff/pr.h
+0-1usr.bin/diff/tests/diff_test.sh
+11-133 files