aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpas_glue.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-02 13:26:50 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-02 13:26:50 (GMT)
commite48f0fb6a794e01c43dc5c8f36380e9cd8e651a2 (patch)
treeff290596de4b811efbbc8b36861ddbfdfdc77b68 /wpa_supplicant/wpas_glue.c
parent16b71ac217b9bb0889ded58c1c700754a376cf85 (diff)
downloadhostap-e48f0fb6a794e01c43dc5c8f36380e9cd8e651a2.zip
hostap-e48f0fb6a794e01c43dc5c8f36380e9cd8e651a2.tar.gz
hostap-e48f0fb6a794e01c43dc5c8f36380e9cd8e651a2.tar.bz2
Use BSS table for WPA get-Beacon-IEs operation
Diffstat (limited to 'wpa_supplicant/wpas_glue.c')
-rw-r--r--wpa_supplicant/wpas_glue.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 18f1bcd..b8a867d 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -30,6 +30,7 @@
#include "common/wpa_ctrl.h"
#include "wpas_glue.h"
#include "wps_supplicant.h"
+#include "bss.h"
#ifndef CONFIG_NO_CONFIG_BLOBS
@@ -300,35 +301,29 @@ static void wpa_supplicant_notify_eapol_done(void *ctx)
static int wpa_get_beacon_ie(struct wpa_supplicant *wpa_s)
{
- size_t i;
int ret = 0;
- struct wpa_scan_res *curr = NULL;
+ struct wpa_bss *curr = NULL, *bss;
struct wpa_ssid *ssid = wpa_s->current_ssid;
const u8 *ie;
- if (wpa_s->scan_res == NULL)
- return -1;
-
- for (i = 0; i < wpa_s->scan_res->num; i++) {
- struct wpa_scan_res *r = wpa_s->scan_res->res[i];
- if (os_memcmp(r->bssid, wpa_s->bssid, ETH_ALEN) != 0)
+ dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
+ if (os_memcmp(bss->bssid, wpa_s->bssid, ETH_ALEN) != 0)
continue;
- ie = wpa_scan_get_ie(r, WLAN_EID_SSID);
if (ssid == NULL ||
- ((ie && ie[1] == ssid->ssid_len &&
- os_memcmp(ie + 2, ssid->ssid, ssid->ssid_len) == 0) ||
+ ((bss->ssid_len == ssid->ssid_len &&
+ os_memcmp(bss->ssid, ssid->ssid, ssid->ssid_len) == 0) ||
ssid->ssid_len == 0)) {
- curr = r;
+ curr = bss;
break;
}
}
if (curr) {
- ie = wpa_scan_get_vendor_ie(curr, WPA_IE_VENDOR_TYPE);
+ ie = wpa_bss_get_vendor_ie(curr, WPA_IE_VENDOR_TYPE);
if (wpa_sm_set_ap_wpa_ie(wpa_s->wpa, ie, ie ? 2 + ie[1] : 0))
ret = -1;
- ie = wpa_scan_get_ie(curr, WLAN_EID_RSN);
+ ie = wpa_bss_get_ie(curr, WLAN_EID_RSN);
if (wpa_sm_set_ap_rsn_ie(wpa_s->wpa, ie, ie ? 2 + ie[1] : 0))
ret = -1;
} else {