]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP/MLO: Forward EAPOL TX status to correct BSS
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Mon, 22 May 2023 19:34:10 +0000 (22:34 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 Jun 2023 14:34:02 +0000 (17:34 +0300)
In case of MLO AP and legacy client, make sure EAPOL TX status is
processed on the correct BSS.

Since there's only one instance of i802_bss for all BSSs in an AP MLD in
the nl80211 driver interface, the link ID is needed to forward the EAPOL
TX status to the correct BSS. Store the link ID when transmitting EAPOL
frames over control interface and report it in TX status.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/ap/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_event.c

index 6c1510a6bff6d5bbc0990a807983f0835e8de1e1..ab956f0c1a0ebb2aa29cff8e5f078c76dc53edbc 100644 (file)
@@ -1986,6 +1986,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                }
                break;
        case EVENT_EAPOL_TX_STATUS:
+               hapd = switch_link_hapd(hapd, data->eapol_tx_status.link_id);
                hostapd_eapol_tx_status(hapd, data->eapol_tx_status.dst,
                                        data->eapol_tx_status.data,
                                        data->eapol_tx_status.data_len,
index cd82e65015ee73751a3e69faa3bd638b56553363..196bcd287db338ca4dfbe54e9fc28c21bd6dd8da 100644 (file)
@@ -6404,6 +6404,7 @@ union wpa_event_data {
         * @data: Data starting with IEEE 802.1X header (!)
         * @data_len: Length of data
         * @ack: Indicates ack or lost frame
+        * @link_id: MLD link id used to transmit the frame or -1 for non MLO
         *
         * This corresponds to hapd_send_eapol if the frame sent
         * there isn't just reported as EVENT_TX_STATUS.
@@ -6413,6 +6414,7 @@ union wpa_event_data {
                const u8 *data;
                int data_len;
                int ack;
+               int link_id;
        } eapol_tx_status;
 
        /**
index b15c9e419159a521df7619018423cd09c3329aef..31e0b1d2f2abf5dc5c35c5fa2b3b529bbbef56a4 100644 (file)
@@ -6145,6 +6145,7 @@ static int nl80211_tx_control_port(void *priv, const u8 *dest,
                           "nl80211: tx_control_port cookie=0x%llx",
                           (long long unsigned int) cookie);
                drv->eapol_tx_cookie = cookie;
+               drv->eapol_tx_link_id = link_id;
        }
 
        return ret;
index 7586e0809d1f4fa014071c070380934aa454656a..42307a9a7db4e1115e7085e2177f913ecd84d064 100644 (file)
@@ -210,6 +210,7 @@ struct wpa_driver_nl80211_data {
        u64 send_frame_cookies[MAX_SEND_FRAME_COOKIES];
        unsigned int num_send_frame_cookies;
        u64 eapol_tx_cookie;
+       int eapol_tx_link_id;
 
        unsigned int last_mgmt_freq;
 
index 82525da72a60690ecc726d0bf3e4e579261eaa8a..0e97a7f4faef5fe4e08cc61941aa18aa554438b2 100644 (file)
@@ -3589,6 +3589,10 @@ nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv,
        event.eapol_tx_status.data = frame + ETH_HLEN;
        event.eapol_tx_status.data_len = len - ETH_HLEN;
        event.eapol_tx_status.ack = ack != NULL;
+       event.eapol_tx_status.link_id =
+               nla_get_u64(cookie) == drv->eapol_tx_cookie ?
+               drv->eapol_tx_link_id : NL80211_DRV_LINK_ID_NA;
+
        wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event);
 }