aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-09-04 14:08:58 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-04 14:08:58 (GMT)
commitc739d7e968ca40b78562e7d3fb98a52eac4f5831 (patch)
treee96792300b9b49b975568945c110d4f041ee6c4e /wpa_supplicant
parent7e414b21c2af7c96c11a5ecf4e153e8e46efaa29 (diff)
downloadhostap-c739d7e968ca40b78562e7d3fb98a52eac4f5831.zip
hostap-c739d7e968ca40b78562e7d3fb98a52eac4f5831.tar.gz
hostap-c739d7e968ca40b78562e7d3fb98a52eac4f5831.tar.bz2
Interworking: Store HESSID in BSS entry
This makes it more convenient to match BSS entries that belong to the same homogenous ESS. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/bss.c19
-rw-r--r--wpa_supplicant/bss.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index a999868..af2033f 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -35,6 +35,22 @@
#define WPA_BSS_IES_CHANGED_FLAG BIT(8)
+static void wpa_bss_set_hessid(struct wpa_bss *bss)
+{
+#ifdef CONFIG_INTERWORKING
+ const u8 *ie = wpa_bss_get_ie(bss, WLAN_EID_INTERWORKING);
+ if (ie == NULL || (ie[1] != 7 && ie[1] != 9)) {
+ os_memset(bss->hessid, 0, ETH_ALEN);
+ return;
+ }
+ if (ie[1] == 7)
+ os_memcpy(bss->hessid, ie + 3, ETH_ALEN);
+ else
+ os_memcpy(bss->hessid, ie + 5, ETH_ALEN);
+#endif /* CONFIG_INTERWORKING */
+}
+
+
struct wpa_bss_anqp * wpa_bss_anqp_alloc(void)
{
struct wpa_bss_anqp *anqp;
@@ -227,6 +243,7 @@ static struct wpa_bss * wpa_bss_add(struct wpa_supplicant *wpa_s,
bss->ie_len = res->ie_len;
bss->beacon_ie_len = res->beacon_ie_len;
os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len);
+ wpa_bss_set_hessid(bss);
dl_list_add_tail(&wpa_s->bss, &bss->list);
dl_list_add_tail(&wpa_s->bss_id, &bss->list_id);
@@ -407,6 +424,8 @@ static void wpa_bss_update(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
}
dl_list_add(prev, &bss->list_id);
}
+ if (changes & WPA_BSS_IES_CHANGED_FLAG)
+ wpa_bss_set_hessid(bss);
dl_list_add_tail(&wpa_s->bss, &bss->list);
notify_bss_changes(wpa_s, changes, bss);
diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h
index 31ae3da..4a386b6 100644
--- a/wpa_supplicant/bss.h
+++ b/wpa_supplicant/bss.h
@@ -47,6 +47,7 @@ struct wpa_bss_anqp {
* @flags: information flags about the BSS/IBSS (WPA_BSS_*)
* @last_update_idx: Index of the last scan update
* @bssid: BSSID
+ * @hessid: HESSID
* @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
* @beacon_int: beacon interval in TUs (host byte order)
* @caps: capability information field in host byte order
@@ -69,6 +70,7 @@ struct wpa_bss {
unsigned int last_update_idx;
unsigned int flags;
u8 bssid[ETH_ALEN];
+ u8 hessid[ETH_ALEN];
u8 ssid[32];
size_t ssid_len;
int freq;