aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorNathan Williams <njw@chromium.org>2011-03-20 10:06:36 (GMT)
committerJouni Malinen <j@w1.fi>2011-03-20 10:06:36 (GMT)
commitbc8397822bcb89139959b4f00931d88db32c6636 (patch)
treeb48a38c255ffd6acc008c99db180f4acd5b4c045 /wpa_supplicant/bss.c
parent2b65b30da86f550dc8c228cb2c6456e76dbc7978 (diff)
downloadhostap-bc8397822bcb89139959b4f00931d88db32c6636.zip
hostap-bc8397822bcb89139959b4f00931d88db32c6636.tar.gz
hostap-bc8397822bcb89139959b4f00931d88db32c6636.tar.bz2
wpa_supplicant: Search BSS list from back to front
This fixes an issue seen in our wifi testbed, where we frequently switch the SSID of the AP. wpa_supplicant's BSS list will have, for example both <bssid, "Check11b"> (from the previous test) and <bssid, "Check11g"> (from the current test) - note that the bssid is the same for both. The (old) D-Bus API for fetching scan responses from wpa_supplicant is fetch-by-bssid, so the caller (flimflam) incorrectly believes we're associated with <bssid, "Check11b">.
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 5809284..145b716 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -492,7 +492,7 @@ struct wpa_bss * wpa_bss_get_bssid(struct wpa_supplicant *wpa_s,
const u8 *bssid)
{
struct wpa_bss *bss;
- dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
+ dl_list_for_each_reverse(bss, &wpa_s->bss, struct wpa_bss, list) {
if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0)
return bss;
}