git: dada5634d4d2 - stable/15 - LinuxKPI: 802.11: lkpi_80211_txq_tx_one() only pass sta if added to drv

Bjoern A. Zeeb <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a66a1f9.27844.5690e14a__22431.6822992236$1785111080$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=dada5634d4d2b02fd0f171cb3df93719ec94fda5

commit dada5634d4d2b02fd0f171cb3df93719ec94fda5
Author:     Bjoern A. Zeeb <[email protected]>
AuthorDate: 2026-07-11 13:35:31 +0000
Commit:     Bjoern A. Zeeb <[email protected]>
CommitDate: 2026-07-26 16:47:54 +0000

    LinuxKPI: 802.11: lkpi_80211_txq_tx_one() only pass sta if added to drv
    
    If we are doing a direct (*tx) downcall, only pass sta as meta data
    if it was added to the driver (via the state machine).  This prevents
    us passing a sta not known to the driver leading to possible follow-up
    complications/errors.  This will usually happen if (a) we are doing
    software scanning, or (b) if net80211 decides to change the ni from
    under us and sends a packet with the new ni.
    
    Adjust a debug statement before to also have the added_to_drv field
    in it to ease debugging.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit c6e70c68d2ce5cfbcace251ef6ed2f1eae912a74)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 5a2355ca5f97..e550e85a5ab9 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -6218,13 +6218,14 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m)
 ops_tx:
 #ifdef LINUXKPI_DEBUG_80211
 	if (linuxkpi_debug_80211 & D80211_TRACE_TX)
-		printf("%s:%d mo_tx :: lsta %p sta %p ni %p %6D skb %p "
-		    "TX ac %d prio %u qmap %u\n",
-		    __func__, __LINE__, lsta, sta, ni, ni->ni_macaddr, ":",
-		    skb, ac, skb->priority, skb->qmap);
+		printf("%s:%d mo_tx :: lsta %p { added_to_drv %d } sta %p "
+		    "ni %p %6D skb %p TX ac %d prio %u qmap %u\n",
+		    __func__, __LINE__, lsta, lsta->added_to_drv, sta,
+		    ni, ni->ni_macaddr, ":", skb, ac, skb->priority, skb->qmap);
 #endif
 	memset(&control, 0, sizeof(control));
-	control.sta = sta;
+	if (lsta->added_to_drv)
+		control.sta = sta;
 	wiphy_lock(hw->wiphy);
 	lkpi_80211_mo_tx(hw, &control, skb);
 	lsta->frms_tx++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.