]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD STA: Use MLD MAC address as destination for EAPOL-Key request
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 6 Nov 2023 18:01:14 +0000 (20:01 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 6 Nov 2023 18:02:09 +0000 (20:02 +0200)
Also this EAPOL frame uses the MLD MAC address of the AP MLD when sent
during an MLO association.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/rsn_supp/wpa.c

index de152550196927519065a65c629c78596b5bc7d0..b3bc2bbedf5ba8e6d609d3adc490168e03991539 100644 (file)
@@ -222,7 +222,7 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise)
        size_t mic_len, hdrlen, rlen;
        struct wpa_eapol_key *reply;
        int key_info, ver;
-       u8 bssid[ETH_ALEN], *rbuf, *key_mic, *mic;
+       u8 *rbuf, *key_mic, *mic;
 
        if (pairwise && sm->wpa_deny_ptk0_rekey && !sm->use_ext_key_id &&
            wpa_sm_get_state(sm) == WPA_COMPLETED && !error) {
@@ -242,12 +242,6 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise)
        else
                ver = WPA_KEY_INFO_TYPE_HMAC_MD5_RC4;
 
-       if (wpa_sm_get_bssid(sm, bssid) < 0) {
-               wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-                       "Failed to read BSSID for EAPOL-Key request");
-               return;
-       }
-
        mic_len = wpa_mic_len(sm->key_mgmt, sm->pmk_len);
        hdrlen = sizeof(*reply) + mic_len + 2;
        rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
@@ -284,8 +278,8 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise)
                "WPA: Sending EAPOL-Key Request (error=%d "
                "pairwise=%d ptk_set=%d len=%lu)",
                error, pairwise, sm->ptk_set, (unsigned long) rlen);
-       wpa_eapol_key_send(sm, &sm->ptk, ver, bssid, ETH_P_EAPOL, rbuf, rlen,
-                          key_mic);
+       wpa_eapol_key_send(sm, &sm->ptk, ver, wpa_sm_get_auth_addr(sm),
+                          ETH_P_EAPOL, rbuf, rlen, key_mic);
 }