]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD STA: Support processing of M1 received before association event
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Wed, 19 Oct 2022 14:14:05 +0000 (19:44 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 31 Oct 2022 15:18:31 +0000 (17:18 +0200)
EAPOL-Key msg 1/4 indication can be received before association
indication from the driver. For MLO connection, the source address check
of such frames should be against the AP MLD address instead of the
associated link BSSID.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index f3cbe975584a12c8dfd6acba70ca8e3e5675123f..f277e2163e9f6b682e413cee2938581c753824b9 100644 (file)
@@ -3635,8 +3635,9 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
                os_get_reltime(&now);
                os_reltime_sub(&now, &wpa_s->pending_eapol_rx_time, &age);
                if (age.sec == 0 && age.usec < 200000 &&
-                   os_memcmp(wpa_s->pending_eapol_rx_src, bssid, ETH_ALEN) ==
-                   0) {
+                   os_memcmp(wpa_s->pending_eapol_rx_src,
+                             wpa_s->valid_links ? wpa_s->ap_mld_addr : bssid,
+                             ETH_ALEN) == 0) {
                        wpa_dbg(wpa_s, MSG_DEBUG, "Process pending EAPOL "
                                "frame that was received just before "
                                "association notification");
index 3d7626aebbcefb09d5dd65e01fb09046df627c39..2532c8382c3b7bea8fd402f95a470551f5f9da5a 100644 (file)
@@ -5143,6 +5143,8 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
                             enum frame_encryption encrypted)
 {
        struct wpa_supplicant *wpa_s = ctx;
+       const u8 *connected_addr = wpa_s->valid_links ?
+               wpa_s->ap_mld_addr : wpa_s->bssid;
 
        wpa_dbg(wpa_s, MSG_DEBUG, "RX EAPOL from " MACSTR " (encrypted=%d)",
                MAC2STR(src_addr), encrypted);
@@ -5168,7 +5170,7 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
 #ifdef CONFIG_AP
             !wpa_s->ap_iface &&
 #endif /* CONFIG_AP */
-            os_memcmp(src_addr, wpa_s->bssid, ETH_ALEN) != 0)) {
+            os_memcmp(src_addr, connected_addr, ETH_ALEN) != 0)) {
                /*
                 * There is possible race condition between receiving the
                 * association event and the EAPOL frame since they are coming
@@ -5181,10 +5183,11 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
                 * Authenticator uses BSSID as the src_addr (which is not the
                 * case with wired IEEE 802.1X).
                 */
-               wpa_dbg(wpa_s, MSG_DEBUG, "Not associated - Delay processing "
-                       "of received EAPOL frame (state=%s bssid=" MACSTR ")",
+               wpa_dbg(wpa_s, MSG_DEBUG,
+                       "Not associated - Delay processing of received EAPOL frame (state=%s connected_addr="
+                       MACSTR ")",
                        wpa_supplicant_state_txt(wpa_s->wpa_state),
-                       MAC2STR(wpa_s->bssid));
+                       MAC2STR(connected_addr));
                wpabuf_free(wpa_s->pending_eapol_rx);
                wpa_s->pending_eapol_rx = wpabuf_alloc_copy(buf, len);
                if (wpa_s->pending_eapol_rx) {
@@ -5197,7 +5200,7 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
        }
 
        wpa_s->last_eapol_matches_bssid =
-               os_memcmp(src_addr, wpa_s->bssid, ETH_ALEN) == 0;
+               os_memcmp(src_addr, connected_addr, ETH_ALEN) == 0;
 
 #ifdef CONFIG_AP
        if (wpa_s->ap_iface) {