]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix AP build without CONFIG_WPS=y
authorJouni Malinen <j@w1.fi>
Mon, 12 Sep 2011 19:23:45 +0000 (22:23 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 12 Sep 2011 19:23:45 +0000 (22:23 +0300)
Make the WPS processing of (Re)Association Request frame IEs conditional
on WPS support. This fixes a build issue with wps_is_20() not being
defined and makes the non-WPS build a bit smaller.

src/ap/drv_callbacks.c

index 443c1fa6a51c3a8961c4f99f02afd2b78e244455..7d6f01b9c781c98fab755a8d5353792442649c19 100644 (file)
@@ -105,6 +105,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
 
        if (hapd->conf->wpa) {
                if (ie == NULL || ielen == 0) {
+#ifdef CONFIG_WPS
                        if (hapd->conf->wps_state) {
                                wpa_printf(MSG_DEBUG, "STA did not include "
                                           "WPA/RSN IE in (Re)Association "
@@ -112,10 +113,12 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                                sta->flags |= WLAN_STA_MAYBE_WPS;
                                goto skip_wpa_check;
                        }
+#endif /* CONFIG_WPS */
 
                        wpa_printf(MSG_DEBUG, "No WPA/RSN IE from STA");
                        return -1;
                }
+#ifdef CONFIG_WPS
                if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 &&
                    os_memcmp(ie + 2, "\x00\x50\xf2\x04", 4) == 0) {
                        struct wpabuf *wps;
@@ -132,6 +135,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                        }
                        goto skip_wpa_check;
                }
+#endif /* CONFIG_WPS */
 
                if (sta->wpa_sm == NULL)
                        sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
@@ -167,6 +171,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                        return -1;
                }
        } else if (hapd->conf->wps_state) {
+#ifdef CONFIG_WPS
                struct wpabuf *wps;
                wps = ieee802_11_vendor_ie_concat(ie, ielen,
                                                  WPS_IE_VENDOR_TYPE);
@@ -194,8 +199,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                } else
                        sta->flags |= WLAN_STA_MAYBE_WPS;
                wpabuf_free(wps);
+#endif /* CONFIG_WPS */
        }
+#ifdef CONFIG_WPS
 skip_wpa_check:
+#endif /* CONFIG_WPS */
 
        new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
        sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;