]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCV: Advertise OCV capability in RSN capabilities (AP)
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2018 18:48:48 +0000 (20:48 +0200)
Set the OCV bit in RSN capabilities (RSNE) based on AP mode
configuration. Do the same for OSEN since it follows the RSNE field
definitions.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
src/ap/hs20.c
src/ap/wpa_auth.h
src/ap/wpa_auth_glue.c
src/ap/wpa_auth_ie.c
wpa_supplicant/ap.c

index b2114b35aca6cc7f4b9bcce47a9a46647b0881f8..532580e7c66c44b86b1fba9c3371b627168c5b60 100644 (file)
@@ -87,6 +87,10 @@ u8 * hostapd_eid_osen(struct hostapd_data *hapd, u8 *eid)
                        capab |= WPA_CAPABILITY_MFPR;
        }
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_OCV
+       if (hapd->conf->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
+#endif /* CONFIG_OCV */
        WPA_PUT_LE16(eid, capab);
        eid += 2;
 
index 564387917346cfb30dff1ba745769514e56d8f72..682fb0f0f28b10cff95a9783e93af1ea624bafec 100644 (file)
@@ -192,6 +192,9 @@ struct wpa_auth_config {
        int group_mgmt_cipher;
        int sae_require_mfp;
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_OCV
+       int ocv; /* Operating Channel Validation */
+#endif /* CONFIG_OCV */
 #ifdef CONFIG_IEEE80211R_AP
        u8 ssid[SSID_MAX_LEN];
        size_t ssid_len;
index 2e24b1c73872e940c54d243fab2d4f6157026be3..7cf22eb25e235031ea627a2fb80506a7e5cb4086 100644 (file)
@@ -55,6 +55,9 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf,
        wconf->wmm_enabled = conf->wmm_enabled;
        wconf->wmm_uapsd = conf->wmm_uapsd;
        wconf->disable_pmksa_caching = conf->disable_pmksa_caching;
+#ifdef CONFIG_OCV
+       wconf->ocv = conf->ocv;
+#endif /* CONFIG_OCV */
        wconf->okc = conf->okc;
 #ifdef CONFIG_IEEE80211W
        wconf->ieee80211w = conf->ieee80211w;
index cdcc5de39d4573c837259d57b59409f7ef1db82c..c945d62a45ba93ddc80bbe8da2d47f286ecbcf25 100644 (file)
@@ -293,9 +293,13 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
                        capab |= WPA_CAPABILITY_MFPR;
        }
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_OCV
+       if (conf->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
+#endif /* CONFIG_OCV */
 #ifdef CONFIG_RSN_TESTING
        if (rsn_testing)
-               capab |= BIT(8) | BIT(14) | BIT(15);
+               capab |= BIT(8) | BIT(15);
 #endif /* CONFIG_RSN_TESTING */
        WPA_PUT_LE16(pos, capab);
        pos += 2;
@@ -414,6 +418,10 @@ static u8 * wpa_write_osen(struct wpa_auth_config *conf, u8 *eid)
                        capab |= WPA_CAPABILITY_MFPR;
        }
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_OCV
+       if (conf->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
+#endif /* CONFIG_OCV */
        WPA_PUT_LE16(eid, capab);
        eid += 2;
 
index ea846a0fad4b86b04b5fcd0235e821c8cc312bcc..7a25b3f6ae0c545adabfd4e25805b920fae6b50f 100644 (file)
@@ -494,6 +494,10 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
                bss->ieee80211w = ssid->ieee80211w;
 #endif /* CONFIG_IEEE80211W */
 
+#ifdef CONFIG_OCV
+       bss->ocv = ssid->ocv;
+#endif /* CONFIG_OCV */
+
 #ifdef CONFIG_WPS
        /*
         * Enable WPS by default for open and WPA/WPA2-Personal network, but