WPS: Do not proxy Probe Request frames to foreign SSIDs to Registrars
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 11 Jun 2010 05:36:34 +0000 (22:36 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 11 Jun 2010 05:36:34 +0000 (22:36 -0700)
We must only indicate stations that are either probing the wildcard SSID
or our own SSID.

src/ap/wps_hostapd.c

index 04d3a85..902a65a 100644 (file)
@@ -782,10 +782,23 @@ static int hostapd_wps_probe_req_rx(void *ctx, const u8 *addr,
 {
        struct hostapd_data *hapd = ctx;
        struct wpabuf *wps_ie;
+       struct ieee802_11_elems elems;
 
        if (hapd->wps == NULL)
                return 0;
 
+       if (ieee802_11_parse_elems(ie, ie_len, &elems, 0) == ParseFailed) {
+               wpa_printf(MSG_DEBUG, "WPS: Could not parse ProbeReq from "
+                          MACSTR, MAC2STR(addr));
+               return 0;
+       }
+
+       if (elems.ssid && elems.ssid_len > 0 &&
+           (elems.ssid_len != hapd->conf->ssid.ssid_len ||
+            os_memcmp(elems.ssid, hapd->conf->ssid.ssid, elems.ssid_len) !=
+            0))
+               return 0; /* Not for us */
+
        wps_ie = ieee802_11_vendor_ie_concat(ie, ie_len, WPS_DEV_OUI_WFA);
        if (wps_ie == NULL)
                return 0;