aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Eilam <guy@wizery.com>2011-08-14 20:12:17 +0300
committerKeith Deacon <kdeacon@ti.com>2011-11-15 20:45:51 -0600
commitff13b671827080fbc51efe400fb54b99fefd9a0c (patch)
tree304d50abc0ca03c41e48ee89ceca3b85b13030ca
parent34923382b6649895e24395f2847c66f6325e5467 (diff)
downloadandroid_external_wpa_supplicant_8-ff13b671827080fbc51efe400fb54b99fefd9a0c.tar.gz
android_external_wpa_supplicant_8-ff13b671827080fbc51efe400fb54b99fefd9a0c.tar.bz2
android_external_wpa_supplicant_8-ff13b671827080fbc51efe400fb54b99fefd9a0c.zip
WPS2: Add WPS IE to Assoc Resp for cases of WLAN_STA_MAYBE_WPS
Add a WPS IE to the Association Response even when the STA is only maybe trying to connect using WPS. This change is needed according to test 4.2.12 in the WSC 2.0 Testplan. A WPS IE is needed even in cases that a station which supports WPS1 tries to connect and doesn't have any WPS IE, RSN IE and WPA IE. This change might cause the WPS IE to be sent also in an Association Response when a STA tries to connect to an Open Network AP (which is configured to WPS). Change-Id: I5bb2dbea3e48bbc2d42fe072ca254957aeed5af7 Signed-off-by: Guy Eilam <guy@wizery.com> Signed-off-by: Vishal Mahaveer <a0271468@ti.com>
-rw-r--r--src/ap/ieee802_11.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index b47bd4ea..66d8d793 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -929,7 +929,14 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
p = hostapd_eid_wmm(hapd, p);
#ifdef CONFIG_WPS
+#ifdef CONFIG_WPS2
+ /* WPS2 must have a WPS IE in the Assoc Resp
+ * even if there's only a small chance that the STA
+ * tries to connect using WPS */
+ if (sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)) {
+#else /* CONFIG_WPS2 */
if (sta->flags & WLAN_STA_WPS) {
+#endif /* CONFIG_WPS2 */
struct wpabuf *wps = wps_build_assoc_resp_ie();
if (wps) {
os_memcpy(p, wpabuf_head(wps), wpabuf_len(wps));