From: Jouni Malinen Date: Sun, 18 Dec 2022 10:04:36 +0000 (+0200) Subject: Do not flush PMKSA cache on restoring dedicated per-ESS MAC address X-Git-Tag: hostap_2_11~1364 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8717110db1a6e16592f7e4fdb03458c9790a1026;p=thirdparty%2Fhostap.git Do not flush PMKSA cache on restoring dedicated per-ESS MAC address Now that we check in PMKSA cache code whether the entry was created for the same local address, it is fine to leave the old entries in the cache even if we have changed addresses. This allows a valid PMKSA cache entry to be used when restoring the same MAC address for the same ESS. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index d3ca2a2dd..c17b67aac 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2452,7 +2452,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, if (status < 0) return; - if (status > 0) /* MAC changed */ + if (rand_style != WPAS_MAC_ADDR_STYLE_DEDICATED_PER_ESS && + status > 0) /* MAC changed */ wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid); } else if (rand_style == WPAS_MAC_ADDR_STYLE_PERMANENT && wpa_s->mac_addr_changed) {