]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Store PMKSA from control interface to both caches
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 26 Feb 2025 14:32:26 +0000 (20:02 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 27 Feb 2025 10:11:44 +0000 (12:11 +0200)
When we cannot determine whether the peer is non-AP MLD, store the PMKSA
into both the MLD-level and per-link caches when operating as an AP MLD.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
src/ap/ctrl_iface_ap.c

index 88ec28f260ce379ceede30ef8f5d06a8b995d33d..441995bcbd2d7ceb56477ad5f99190a40237498d 100644 (file)
@@ -1198,6 +1198,7 @@ int hostapd_ctrl_iface_pmksa_add(struct hostapd_data *hapd, char *cmd)
        size_t pmk_len;
        char *pos, *pos2;
        int akmp = 0, expiration = 0;
+       int ret;
 
        /*
         * Entry format:
@@ -1233,8 +1234,18 @@ int hostapd_ctrl_iface_pmksa_add(struct hostapd_data *hapd, char *cmd)
        if (sscanf(pos, "%d %d", &expiration, &akmp) != 2)
                return -1;
 
-       return wpa_auth_pmksa_add2(hapd->wpa_auth, spa, pmk, pmk_len,
-                                  pmkid, expiration, akmp, NULL, false);
+       ret = wpa_auth_pmksa_add2(hapd->wpa_auth, spa, pmk, pmk_len,
+                                 pmkid, expiration, akmp, NULL, false);
+       if (ret)
+               return ret;
+
+#ifdef CONFIG_IEEE80211BE
+       if (hapd->conf->mld_ap)
+               ret = wpa_auth_pmksa_add2(hapd->wpa_auth, spa, pmk, pmk_len,
+                                         pmkid, expiration, akmp, NULL, true);
+#endif /* CONFIG_IEEE80211BE */
+
+       return ret;
 }