Fix WPS in non-WPA modes with drivers that implement MLME
authorJouni Malinen <j@w1.fi>
Mon, 23 Feb 2009 18:57:07 +0000 (20:57 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 23 Feb 2009 18:57:07 +0000 (20:57 +0200)
Need to set WLAN_STA_WPS and WLAN_STA_MAYBE_WPS flags even if WPA is not
enabled. This allows open and static WEP modes to initiate WPS
negotiation with madwifi-like drivers.

hostapd/drv_callbacks.c

index e5b2efb..ccdd428 100644 (file)
@@ -208,6 +208,12 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                        wpa_hexdump(MSG_DEBUG, "IE", ie, ielen);
                        return -1;
                }
+       } else if (hapd->conf->wps_state) {
+               if (ie && ielen > 4 && ie[0] == 0xdd && ie[1] >= 4 &&
+                   os_memcmp(ie + 2, "\x00\x50\xf2\x04", 4) == 0) {
+                       sta->flags |= WLAN_STA_WPS;
+               } else
+                       sta->flags |= WLAN_STA_MAYBE_WPS;
        }
 skip_wpa_check: