Add support for hidden SSID in wpa_supplicant AP mode
authorVivek Natarajan <nataraja@qca.qualcomm.com>
Mon, 27 Feb 2012 14:28:45 +0000 (16:28 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 27 Feb 2012 14:28:45 +0000 (16:28 +0200)
This also disables WPS support if hidden SSID is enabled in AP mode.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/ap.c
wpa_supplicant/config.c
wpa_supplicant/config_ssid.h

index 52f421a..48a6169 100644 (file)
@@ -145,6 +145,8 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
        bss->ssid.ssid_len = ssid->ssid_len;
        bss->ssid.ssid_set = 1;
 
+       bss->ignore_broadcast_ssid = ssid->ignore_broadcast_ssid;
+
        if (ssid->auth_alg)
                bss->auth_algs = ssid->auth_alg;
 
@@ -238,7 +240,10 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
                              * configuration */
 #endif /* CONFIG_WPS2 */
        bss->eap_server = 1;
-       bss->wps_state = 2;
+
+       if (!ssid->ignore_broadcast_ssid)
+               bss->wps_state = 2;
+
        bss->ap_setup_locked = 2;
        if (wpa_s->conf->config_methods)
                bss->config_methods = os_strdup(wpa_s->conf->config_methods);
index 9fd2a70..0aae8af 100644 (file)
@@ -1589,6 +1589,7 @@ static const struct parse_data ssid_fields[] = {
        { INT_RANGE(frequency, 0, 10000) },
        { INT(wpa_ptk_rekey) },
        { STR(bgscan) },
+       { INT_RANGE(ignore_broadcast_ssid, 0, 2) },
 #ifdef CONFIG_P2P
        { FUNC(p2p_client_list) },
 #endif /* CONFIG_P2P */
index 2605ae8..f2bb597 100644 (file)
@@ -377,6 +377,20 @@ struct wpa_ssid {
        char *bgscan;
 
        /**
+        * ignore_broadcast_ssid - Hide SSID in AP mode
+        *
+        * Send empty SSID in beacons and ignore probe request frames that do
+        * not specify full SSID, i.e., require stations to know SSID.
+        * default: disabled (0)
+        * 1 = send empty (length=0) SSID in beacon and ignore probe request
+        * for broadcast SSID
+        * 2 = clear SSID (ASCII 0), but keep the original length (this may be
+        * required with some clients that do not support empty SSID) and
+        * ignore probe requests for broadcast SSID
+        */
+       int ignore_broadcast_ssid;
+
+       /**
         * freq_list - Array of allowed frequencies or %NULL for all
         *
         * This is an optional zero-terminated array of frequencies in