]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add a hostapd testing option for skipping association pruning
authorJouni Malinen <j@w1.fi>
Sat, 28 Mar 2020 18:39:19 +0000 (20:39 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Mar 2020 18:39:19 +0000 (20:39 +0200)
The new skip_prune_assoc=1 parameter can be used to configure hostapd
not to prune associations from other BSSs operated by the same process
when a station associates with another BSS. This can be helpful in
testing roaming cases where association and authorization state is
maintained in an AP when the stations returns.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/config_file.c
src/ap/ap_config.h
src/ap/utils.c

index 7a184c440d54a4c935fbf19e182aef827cf69c51..425446c2403680b2eab37a249718601217e7c55a 100644 (file)
@@ -4206,6 +4206,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->igtk_rsc_override = wpabuf_parse_bin(pos);
        } else if (os_strcmp(buf, "no_beacon_rsnxe") == 0) {
                bss->no_beacon_rsnxe = atoi(pos);
+       } else if (os_strcmp(buf, "skip_prune_assoc") == 0) {
+               bss->skip_prune_assoc = atoi(pos);
 #endif /* CONFIG_TESTING_OPTIONS */
 #ifdef CONFIG_SAE
        } else if (os_strcmp(buf, "sae_password") == 0) {
index 7930fc3743819254c3f551940ebd2d6c50855e89..2a0bf07631bb568c3467f0289d450cf4c080904b 100644 (file)
@@ -685,6 +685,7 @@ struct hostapd_bss_config {
        struct wpabuf *gtk_rsc_override;
        struct wpabuf *igtk_rsc_override;
        int no_beacon_rsnxe;
+       int skip_prune_assoc;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #define MESH_ENABLED BIT(0)
index fcb371bec28343c90c478f80cb392588c3b923eb..bedad6eb02f7bfda2b421ad4591e0edd6438b09a 100644 (file)
@@ -56,6 +56,10 @@ static int prune_associations(struct hostapd_iface *iface, void *ctx)
                ohapd = iface->bss[j];
                if (ohapd == data->hapd)
                        continue;
+#ifdef CONFIG_TESTING_OPTIONS
+               if (ohapd->conf->skip_prune_assoc)
+                       continue;
+#endif /* CONFIG_TESTING_OPTIONS */
 #ifdef CONFIG_FST
                /* Don't prune STAs belong to same FST */
                if (ohapd->iface->fst &&