mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-26 13:49:35 -05:00
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>
This commit is contained in:
parent
72728c6fa8
commit
b06800170a
@ -926,6 +926,15 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
|
|||||||
return -1;
|
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
|
* Do not trigger new association unless the BSSID has changed or if
|
||||||
* reassociation is requested. If we are in process of associating with
|
* 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 &&
|
(os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0 &&
|
||||||
((wpa_s->wpa_state != WPA_ASSOCIATING &&
|
((wpa_s->wpa_state != WPA_ASSOCIATING &&
|
||||||
wpa_s->wpa_state != WPA_AUTHENTICATING) ||
|
wpa_s->wpa_state != WPA_AUTHENTICATING) ||
|
||||||
|
(!is_zero_ether_addr(wpa_s->pending_bssid) &&
|
||||||
os_memcmp(selected->bssid, wpa_s->pending_bssid, ETH_ALEN) !=
|
os_memcmp(selected->bssid, wpa_s->pending_bssid, ETH_ALEN) !=
|
||||||
0))) {
|
0) ||
|
||||||
|
(is_zero_ether_addr(wpa_s->pending_bssid) &&
|
||||||
|
ssid != wpa_s->current_ssid)))) {
|
||||||
if (wpa_supplicant_scard_init(wpa_s, ssid)) {
|
if (wpa_supplicant_scard_init(wpa_s, ssid)) {
|
||||||
wpa_supplicant_req_new_scan(wpa_s, 10, 0);
|
wpa_supplicant_req_new_scan(wpa_s, 10, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
wpa_msg(wpa_s, MSG_DEBUG, "Request association: "
|
wpa_msg(wpa_s, MSG_DEBUG, "Request association with " MACSTR,
|
||||||
"reassociate: %d selected: "MACSTR " bssid: " MACSTR
|
MAC2STR(selected->bssid));
|
||||||
" 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_supplicant_associate(wpa_s, selected, ssid);
|
wpa_supplicant_associate(wpa_s, selected, ssid);
|
||||||
} else {
|
} else {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "Already associated with the "
|
wpa_dbg(wpa_s, MSG_DEBUG, "Already associated or trying to "
|
||||||
"selected AP");
|
"connect with the selected AP");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user