aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-16 14:11:05 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-16 14:11:05 (GMT)
commit8c0906542c06d862ffae10e2984330b28ed505a6 (patch)
treef5835fa68878ccbde2ac8e6db2a7c932718da352 /wpa_supplicant/bss.c
parent94627f6cc8be8693b6c6a7a6407fcf94ba0a7edb (diff)
downloadhostap-8c0906542c06d862ffae10e2984330b28ed505a6.zip
hostap-8c0906542c06d862ffae10e2984330b28ed505a6.tar.gz
hostap-8c0906542c06d862ffae10e2984330b28ed505a6.tar.bz2
Fetch IEs from both Beacon and Probe Response frames if available
This allows the driver wrappers to return two sets of IEs, so that the BSS code can use information from both Beacon and Probe Response frames if needed. For example, some Cisco APs seem to include more information in Wireless Provisioning Services IE when it is in the Beacon frame.
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index b1d9b67..414fa35 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -120,7 +120,7 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
{
struct wpa_bss *bss;
- bss = os_zalloc(sizeof(*bss) + res->ie_len);
+ bss = os_zalloc(sizeof(*bss) + res->ie_len + res->beacon_ie_len);
if (bss == NULL)
return;
bss->id = wpa_s->bss_next_id++;
@@ -129,7 +129,8 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
os_memcpy(bss->ssid, ssid, ssid_len);
bss->ssid_len = ssid_len;
bss->ie_len = res->ie_len;
- os_memcpy(bss + 1, res + 1, res->ie_len);
+ bss->beacon_ie_len = res->beacon_ie_len;
+ os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len);
dl_list_add_tail(&wpa_s->bss, &bss->list);
dl_list_add_tail(&wpa_s->bss_id, &bss->list_id);
@@ -273,18 +274,23 @@ static void wpa_bss_update(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
wpa_bss_copy_res(bss, res);
/* Move the entry to the end of the list */
dl_list_del(&bss->list);
- if (bss->ie_len >= res->ie_len) {
- os_memcpy(bss + 1, res + 1, res->ie_len);
+ if (bss->ie_len + bss->beacon_ie_len >=
+ res->ie_len + res->beacon_ie_len) {
+ os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len);
bss->ie_len = res->ie_len;
+ bss->beacon_ie_len = res->beacon_ie_len;
} else {
struct wpa_bss *nbss;
struct dl_list *prev = bss->list_id.prev;
dl_list_del(&bss->list_id);
- nbss = os_realloc(bss, sizeof(*bss) + res->ie_len);
+ nbss = os_realloc(bss, sizeof(*bss) + res->ie_len +
+ res->beacon_ie_len);
if (nbss) {
bss = nbss;
- os_memcpy(bss + 1, res + 1, res->ie_len);
+ os_memcpy(bss + 1, res + 1,
+ res->ie_len + res->beacon_ie_len);
bss->ie_len = res->ie_len;
+ bss->beacon_ie_len = res->beacon_ie_len;
}
dl_list_add(prev, &bss->list_id);
}