aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorMatti Gottlieb <matti.gottlieb@intel.com>2015-04-28 11:01:04 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-03 14:32:32 (GMT)
commit0c28071872242d1acaaf18034ea39b0635fe604a (patch)
tree93425ad7552deae2dd1d594043191404a3a02a1e /wpa_supplicant
parent74197e0adf4c63ba5551ed7e816f7d61e74a36b1 (diff)
downloadhostap-0c28071872242d1acaaf18034ea39b0635fe604a.zip
hostap-0c28071872242d1acaaf18034ea39b0635fe604a.tar.gz
hostap-0c28071872242d1acaaf18034ea39b0635fe604a.tar.bz2
Fix sending ANQP request to an unknown BSS while associated
While being associated, if an ANQP request is received for a different AP that doesn't exist in the BSS list, the ANQP request will be sent on the frequency of the AP that we are currently associated to. In such a case, it is possible that the ANQP request would be sent on a channel different than that of the requested AP, potentially delaying other requests/activities. Avoid sending the ANQP request to an AP that is not in the BSS list. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/hs20_supplicant.c14
-rw-r--r--wpa_supplicant/interworking.c14
2 files changed, 16 insertions, 12 deletions
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index 98af530..a1afc85 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -188,14 +188,16 @@ int hs20_anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst, u32 stypes,
struct wpa_bss *bss;
int res;
- freq = wpa_s->assoc_freq;
bss = wpa_bss_get_bssid(wpa_s, dst);
- if (bss) {
- wpa_bss_anqp_unshare_alloc(bss);
- freq = bss->freq;
- }
- if (freq <= 0)
+ if (!bss) {
+ wpa_printf(MSG_WARNING,
+ "ANQP: Cannot send query to unknown BSS "
+ MACSTR, MAC2STR(dst));
return -1;
+ }
+
+ wpa_bss_anqp_unshare_alloc(bss);
+ freq = bss->freq;
wpa_printf(MSG_DEBUG, "HS20: ANQP Query Request to " MACSTR " for "
"subtypes 0x%x", MAC2STR(dst), stypes);
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 35885ee..fd47c17 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -2673,14 +2673,16 @@ int anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst,
struct wpa_bss *bss;
int res;
- freq = wpa_s->assoc_freq;
bss = wpa_bss_get_bssid(wpa_s, dst);
- if (bss) {
- wpa_bss_anqp_unshare_alloc(bss);
- freq = bss->freq;
- }
- if (freq <= 0)
+ if (!bss) {
+ wpa_printf(MSG_WARNING,
+ "ANQP: Cannot send query to unknown BSS "
+ MACSTR, MAC2STR(dst));
return -1;
+ }
+
+ wpa_bss_anqp_unshare_alloc(bss);
+ freq = bss->freq;
wpa_msg(wpa_s, MSG_DEBUG,
"ANQP: Query Request to " MACSTR " for %u id(s)",