From 8266e6c6b4b9060eb025b2737811ac2f7c8723d5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jan 2015 17:47:32 +0200 Subject: [PATCH] HS 2.0: Try to use same BSS entry for storing GAS results Commit 17b8995cf5813d7c027cd7a6884700e791d72392 ('Interworking: Try to use same BSS entry for storing GAS results') added a mechanism to try to pair GAS request and response to a single BSS entry to cover cases where multiple BSS entries may exists for the same BSSID. However, that commit did not cover the Hotspot 2.0 ANQP elements. Extend this mechanism to all ANQP elements. This can help in cases where information in the Hotspot 2.0 specific ANQP elements got lost if a hidden SSID or some other reason of duplicated BSS entries was present while doing ANQP fetches. Signed-off-by: Jouni Malinen --- wpa_supplicant/hs20_supplicant.c | 4 ++-- wpa_supplicant/hs20_supplicant.h | 3 ++- wpa_supplicant/interworking.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c index 9eb506462..53c7d63c8 100644 --- a/wpa_supplicant/hs20_supplicant.c +++ b/wpa_supplicant/hs20_supplicant.c @@ -327,11 +327,11 @@ static void hs20_osu_icon_fetch_result(struct wpa_supplicant *wpa_s, int res) void hs20_parse_rx_hs20_anqp_resp(struct wpa_supplicant *wpa_s, - const u8 *sa, const u8 *data, size_t slen) + struct wpa_bss *bss, const u8 *sa, + const u8 *data, size_t slen) { const u8 *pos = data; u8 subtype; - struct wpa_bss *bss = wpa_bss_get_bssid(wpa_s, sa); struct wpa_bss_anqp *anqp = NULL; int ret; diff --git a/wpa_supplicant/hs20_supplicant.h b/wpa_supplicant/hs20_supplicant.h index 06739f5c9..85b512012 100644 --- a/wpa_supplicant/hs20_supplicant.h +++ b/wpa_supplicant/hs20_supplicant.h @@ -17,7 +17,8 @@ struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload, void hs20_put_anqp_req(u32 stypes, const u8 *payload, size_t payload_len, struct wpabuf *buf); void hs20_parse_rx_hs20_anqp_resp(struct wpa_supplicant *wpa_s, - const u8 *sa, const u8 *data, size_t slen); + struct wpa_bss *bss, const u8 *sa, + const u8 *data, size_t slen); int is_hs20_network(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, struct wpa_bss *bss); int hs20_get_pps_mo_id(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index f085c8906..cae1f7566 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -2749,8 +2749,8 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s, switch (type) { case HS20_ANQP_OUI_TYPE: - hs20_parse_rx_hs20_anqp_resp(wpa_s, sa, pos, - slen); + hs20_parse_rx_hs20_anqp_resp(wpa_s, bss, sa, + pos, slen); break; default: wpa_printf(MSG_DEBUG, "HS20: Unsupported ANQP "