aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-07-11 13:35:31 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-07-26 16:47:54 +0000
commitdada5634d4d2b02fd0f171cb3df93719ec94fda5 (patch)
tree4a5e3393ad8c3a305399df43b266526d355aef51
parent19a8d8f55f070cf2c351e8c1bfe17efafd1f4f32 (diff)
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)
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c11
1 files 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++;