[PATCH] nl80211: Ignore the link ID of spurious frames on a non-MLD

Andrei Otcheretianski andrei.otcheretianski at intel.com
Thu Oct 8 04:55:50 PDT 2026


mac80211 normalizes the link ID of the default link to 0, so the kernel
reports NL80211_ATTR_MLO_LINK_ID = 0 in NL80211_CMD_UNEXPECTED_FRAME and
NL80211_CMD_UNEXPECTED_4ADDR_FRAME events even for an AP that is not an
MLD. Such a BSS has no valid links, so the link validation rejected
every one of these events and hostapd stopped reacting to Class 3 frames
received from unassociated stations and to unexpected 4-address frames.

This broke the hwsim tests that depend on these events: ap_open_ifdown,
ap_pmf_ap_dropping_sa and hapd_ctrl_disconnect_no_tx, where the station
is no longer deauthenticated or disassociated, and ap_wds_sta,
ap_wds_sta_eap, ap_wds_sta_open and ap_wds_sta_wep, where the 4-address
WDS interface is never set up.

Skip the link handling altogether when the BSS is not an MLD.

Fixes: 44d144d60364 ("nl80211: Handle WDS events on appropriate link in AP MLD")

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/drivers/driver_nl80211_event.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 86f7372b59..3deec385a3 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2878,7 +2878,13 @@ static void nl80211_spurious_frame(struct i802_bss *bss, struct nlattr **tb,
 		nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]) : -1;
 	link_id = event.rx_from_unknown.link_id;
 
-	if (link_id >= 0) {
+	/*
+	 * The kernel reports link ID 0 for the default link, so the link is
+	 * relevant only when this BSS is actually an MLD.
+	 */
+	if (!bss->valid_links) {
+		event.rx_from_unknown.link_id = -1;
+	} else if (link_id >= 0) {
 		if (!nl80211_link_valid(bss->valid_links, link_id)) {
 			wpa_printf(MSG_DEBUG,
 				   "nl80211: Ignoring unknown RX event from link_id %d",
-- 
2.53.0




More information about the Hostap mailing list