]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Handle link_id for EVENT_RX_FROM_UNKNOWN
authorMichael-CY Lee <michael-cy.lee@mediatek.com>
Tue, 22 Jul 2025 02:01:27 +0000 (10:01 +0800)
committerJouni Malinen <j@w1.fi>
Thu, 2 Oct 2025 20:30:48 +0000 (23:30 +0300)
The AP MLD may require the "link_id" to properly handle unexpected
frames. For instance, if the AP MLD receives a Data frame from a
non-associated STA, it must send deauthentication to the link on which
the STA is operating.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Reviewed-by: Money Wang <money.wang@mediatek.com>
src/ap/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_nl80211_event.c

index 51badb7c16697df940a2d6b47cd34b88583bfaa5..769d8f32c504670fce0631b14ebd864fd60f8327 100644 (file)
@@ -2649,6 +2649,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                hostapd_client_poll_ok(hapd, data->client_poll.addr);
                break;
        case EVENT_RX_FROM_UNKNOWN:
+               hapd = switch_link_hapd(hapd, data->rx_from_unknown.link_id);
                hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.bssid,
                                            data->rx_from_unknown.addr,
                                            data->rx_from_unknown.wds);
index fbd4a546c6a0fa195ccd319a0b43c9c2544d2e95..ada274e43c80db18aca2adca81a5cd5d6fbde0bb 100644 (file)
@@ -6660,6 +6660,7 @@ union wpa_event_data {
                const u8 *bssid;
                const u8 *addr;
                int wds;
+               int link_id;
        } rx_from_unknown;
 
        /**
index 9e4a3e6e1a9a365a1be4cd339496bd08c9c5cc23..7a54ff21e1d9ffa047e648527ce692cc6fe74451 100644 (file)
@@ -2789,6 +2789,8 @@ static void nl80211_spurious_frame(struct i802_bss *bss, struct nlattr **tb,
        event.rx_from_unknown.bssid = bss->addr;
        event.rx_from_unknown.addr = nla_data(tb[NL80211_ATTR_MAC]);
        event.rx_from_unknown.wds = wds;
+       event.rx_from_unknown.link_id = tb[NL80211_ATTR_MLO_LINK_ID] ?
+               nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]) : -1;
 
        wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event);
 }