aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-02-17 22:16:55 (GMT)
committerJouni Malinen <j@w1.fi>2020-02-17 22:18:47 (GMT)
commitecbf59e6931f304801fa728b191b2b7506908059 (patch)
tree59a40c508ef72bf52fae4bdfda575ce8d44cc247
parent16889aff408ec585af64d10fc6adc3a7588a2585 (diff)
downloadhostap-ecbf59e6931f304801fa728b191b2b7506908059.zip
hostap-ecbf59e6931f304801fa728b191b2b7506908059.tar.gz
hostap-ecbf59e6931f304801fa728b191b2b7506908059.tar.bz2
wpa_supplicant configuration for Beacon protection
Add a new wpa_supplicant network profile configuration parameter beacon_prot=<0/1> to allow Beacon protection to be enabled. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--src/rsn_supp/wpa.c2
-rw-r--r--src/rsn_supp/wpa.h1
-rw-r--r--src/rsn_supp/wpa_i.h1
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config_file.c1
-rw-r--r--wpa_supplicant/config_ssid.h8
-rw-r--r--wpa_supplicant/wpas_glue.c1
7 files changed, 15 insertions, 0 deletions
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 039f076..981602c 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -2959,6 +2959,7 @@ void wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config)
} else {
sm->fils_cache_id_set = 0;
}
+ sm->beacon_prot = config->beacon_prot;
#endif /* CONFIG_FILS */
} else {
sm->network_ctx = NULL;
@@ -2971,6 +2972,7 @@ void wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config)
sm->p2p = 0;
sm->wpa_rsc_relaxation = 0;
sm->owe_ptk_workaround = 0;
+ sm->beacon_prot = 0;
}
}
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index ceae721..e14f26e 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -115,6 +115,7 @@ struct rsn_supp_config {
int wpa_rsc_relaxation;
int owe_ptk_workaround;
const u8 *fils_cache_id;
+ int beacon_prot;
};
#ifndef CONFIG_NO_WPA
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index e088a5a..164adfb 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -64,6 +64,7 @@ struct wpa_sm {
int p2p;
int wpa_rsc_relaxation;
int owe_ptk_workaround;
+ int beacon_prot;
u8 own_addr[ETH_ALEN];
const char *ifname;
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index b83c36a..9dad4ff 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2569,6 +2569,7 @@ static const struct parse_data ssid_fields[] = {
{ INT_RANGE(owe_ptk_workaround, 0, 1) },
{ INT_RANGE(multi_ap_backhaul_sta, 0, 1) },
{ INT_RANGE(ft_eap_pmksa_caching, 0, 1) },
+ { INT_RANGE(beacon_prot, 0, 1) },
};
#undef OFFSET
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index fd2bdff..29bd81f 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -913,6 +913,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
INT(owe_ptk_workaround);
INT(multi_ap_backhaul_sta);
INT(ft_eap_pmksa_caching);
+ INT(beacon_prot);
#ifdef CONFIG_HT_OVERRIDES
INT_DEF(disable_ht, DEFAULT_DISABLE_HT);
INT_DEF(disable_ht40, DEFAULT_DISABLE_HT40);
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index b752dfd..5642d0d 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -1047,6 +1047,14 @@ struct wpa_ssid {
* FT initial mobility domain association.
*/
int ft_eap_pmksa_caching;
+
+ /**
+ * beacon_prot - Whether Beacon protection is enabled
+ *
+ * This depends on management frame protection (ieee80211w) being
+ * enabled.
+ */
+ int beacon_prot;
};
#endif /* CONFIG_SSID_H */
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index f113bfe..e8747e6 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1309,6 +1309,7 @@ void wpa_supplicant_rsn_supp_set_config(struct wpa_supplicant *wpa_s,
conf.fils_cache_id =
wpa_bss_get_fils_cache_id(wpa_s->current_bss);
#endif /* CONFIG_FILS */
+ conf.beacon_prot = ssid->beacon_prot;
}
wpa_sm_set_config(wpa_s->wpa, ssid ? &conf : NULL);
}