]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not flush PMKSA cache on restoring dedicated per-ESS MAC address
authorJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 10:04:36 +0000 (12:04 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 10:33:16 +0000 (12:33 +0200)
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 <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index d3ca2a2ddceb0757d14b926ce3a3a03a1e309721..c17b67aac4de84ae9c37ba690ec69a35f6212923 100644 (file)
@@ -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) {