From: Chenming Huang Date: Wed, 26 Feb 2025 14:32:26 +0000 (+0530) Subject: AP MLD: Store PMKSA from control interface to both caches X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4645fac93424780582a99daecb97f54789482048;p=thirdparty%2Fhostap.git AP MLD: Store PMKSA from control interface to both caches 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 --- diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index 88ec28f26..441995bcb 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -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; }