]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant configuration for Beacon protection
authorJouni Malinen <jouni@codeaurora.org>
Mon, 17 Feb 2020 22:16:55 +0000 (00:16 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 17 Feb 2020 22:18:47 +0000 (00:18 +0200)
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>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_i.h
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/wpas_glue.c

index 039f076fa8b2bf3c9bcbc70098ee4d281a56f214..981602c5d7571996101bfbc5a275c5bcf69759cc 100644 (file)
@@ -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;
        }
 }
 
index ceae721aaa4fe5c523e5654dde1a7fb4b745d230..e14f26e01ec558837fe157d0114f0a673acb5cd3 100644 (file)
@@ -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
index e088a5aa7fdb9e20eb9f8168c2381e1d112f61c1..164adfbc0dc6b7eb3324b04df18d759c0f2d70c0 100644 (file)
@@ -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;
index b83c36ae9dfa3c71d29cb3cae951d5d3121c28ca..9dad4ff7231d9667313de1de2d3e5bc80851aa29 100644 (file)
@@ -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
index fd2bdff480cd684d34614ed1924775c11c01dfe3..29bd81f0a8ff6286fb3fd0ccdeca87af1c434043 100644 (file)
@@ -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);
index b752dfdda3893d54766052a45c60610f4c4aa9d8..5642d0ddf98f80aca23ce3b29c6bfc30eb028881 100644 (file)
@@ -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 */
index f113bfe2991aaee51adc2f827211cef1080aeca5..e8747e613a3078e2f90b407d30bb3d4c232a1ce7 100644 (file)
@@ -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);
 }