WPS: Include WSC IE in (Re)Association Response for maybe-WPS case
authorJouni Malinen <j@w1.fi>
Thu, 24 Nov 2011 20:05:33 +0000 (22:05 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 24 Nov 2011 20:05:33 +0000 (22:05 +0200)
If the station is indicating use of WPS, WSC IE should be added into the
(Re)Association Response frame. This is clear for the case when WSC IE
was included in the (Re)Association Request frame. However, even the
WLAN_STA_MAYBE_WPS case may actually indicate use of WPS. Assume that to
be the case when WPA/WPA2 is enabled (i.e., when the STA does not
include WPA/RSN/WSC IE while AP has WPA/RSN enabled).

Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/ieee802_11.c

index 36f04d5..a8a9bd4 100644 (file)
@@ -868,7 +868,8 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
                p = hostapd_eid_wmm(hapd, p);
 
 #ifdef CONFIG_WPS
-       if (sta->flags & WLAN_STA_WPS) {
+       if ((sta->flags & WLAN_STA_WPS) ||
+           ((sta->flags & WLAN_STA_MAYBE_WPS) && hapd->conf->wpa)) {
                struct wpabuf *wps = wps_build_assoc_resp_ie();
                if (wps) {
                        os_memcpy(p, wpabuf_head(wps), wpabuf_len(wps));