aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-05-21 16:34:00 (GMT)
committerJouni Malinen <j@w1.fi>2013-05-22 13:10:59 (GMT)
commitb06800170ada9fc7985e7ca7e92f9c386ab47811 (patch)
tree7fd40285ca2ad8b92acdbc0ca9d8a3bc8a7043a6 /wpa_supplicant/events.c
parent72728c6fa8e63f7eb2b6e54e6a610d569483eee5 (diff)
downloadhostap-b06800170ada9fc7985e7ca7e92f9c386ab47811.zip
hostap-b06800170ada9fc7985e7ca7e92f9c386ab47811.tar.gz
hostap-b06800170ada9fc7985e7ca7e92f9c386ab47811.tar.bz2
Fix already-associated detection with driver-based BSS selection
wpa_s->pending_bssid is all zeros during connection attempt when driver-based BSS selection is used. Take this into account when determining whether new scan results should trigger a connection based on wpa_s->current_ssid, i.e., a connection attempt with the selected network instead of selected BSS. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 463c8e6..50a0dbd 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -926,6 +926,15 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
return -1;
}
+ wpa_msg(wpa_s, MSG_DEBUG,
+ "Considering connect request: reassociate: %d selected: "
+ MACSTR " bssid: " MACSTR " pending: " MACSTR
+ " wpa_state: %s ssid=%p current_ssid=%p",
+ wpa_s->reassociate, MAC2STR(selected->bssid),
+ MAC2STR(wpa_s->bssid), MAC2STR(wpa_s->pending_bssid),
+ wpa_supplicant_state_txt(wpa_s->wpa_state),
+ ssid, wpa_s->current_ssid);
+
/*
* Do not trigger new association unless the BSSID has changed or if
* reassociation is requested. If we are in process of associating with
@@ -935,22 +944,21 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
(os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0 &&
((wpa_s->wpa_state != WPA_ASSOCIATING &&
wpa_s->wpa_state != WPA_AUTHENTICATING) ||
- os_memcmp(selected->bssid, wpa_s->pending_bssid, ETH_ALEN) !=
- 0))) {
+ (!is_zero_ether_addr(wpa_s->pending_bssid) &&
+ os_memcmp(selected->bssid, wpa_s->pending_bssid, ETH_ALEN) !=
+ 0) ||
+ (is_zero_ether_addr(wpa_s->pending_bssid) &&
+ ssid != wpa_s->current_ssid)))) {
if (wpa_supplicant_scard_init(wpa_s, ssid)) {
wpa_supplicant_req_new_scan(wpa_s, 10, 0);
return 0;
}
- wpa_msg(wpa_s, MSG_DEBUG, "Request association: "
- "reassociate: %d selected: "MACSTR " bssid: " MACSTR
- " pending: " MACSTR " wpa_state: %s",
- wpa_s->reassociate, MAC2STR(selected->bssid),
- MAC2STR(wpa_s->bssid), MAC2STR(wpa_s->pending_bssid),
- wpa_supplicant_state_txt(wpa_s->wpa_state));
+ wpa_msg(wpa_s, MSG_DEBUG, "Request association with " MACSTR,
+ MAC2STR(selected->bssid));
wpa_supplicant_associate(wpa_s, selected, ssid);
} else {
- wpa_dbg(wpa_s, MSG_DEBUG, "Already associated with the "
- "selected AP");
+ wpa_dbg(wpa_s, MSG_DEBUG, "Already associated or trying to "
+ "connect with the selected AP");
}
return 0;