path: root/wpa_supplicant/bss.c
diff options
authorJouni Malinen <jouni@qca.qualcomm.com>2014-12-02 17:42:23 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-02 17:46:58 (GMT)
commit44177b69e8854177044aad4c57cf9cce8269b306 (patch)
tree3b3b34b4ce6e76a87777d0345367d4a20ea3f472 /wpa_supplicant/bss.c
parente48635cfb02dc49bad2783605db71ac2b1833264 (diff)
Allow a BSS entry with all-zeros BSSID to expire
wpa_bss_in_use() used to determine that a BSS with BSSID of 00:00:00:00:00:00 is in use in almost every case since either wpa_s->bssid or wpa_s->pending_bssid was likely to be cleared. This could result in a corner case of a BSS entry remaining in the BSS table indefinitely if one was added there with a (likely bogus) address of 00:00:00:00:00:00. Fix this by ignore wpa_s->bssid and wpa_s->pending_bssid if the BSSID in the BSS table entry is 00:00:00:00:00:00. In theory, that address is a valid BSSID, but it is unlikely to be used in any production AP, so the potential expiration of a BSS entry with that address during a connection attempt would not be a concern (especially when a new scan would be enough to recover from that). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/bss.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 055aef0..1798439 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -306,8 +306,9 @@ static int wpa_bss_known(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
static int wpa_bss_in_use(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
return bss == wpa_s->current_bss ||
- os_memcmp(bss->bssid, wpa_s->bssid, ETH_ALEN) == 0 ||
- os_memcmp(bss->bssid, wpa_s->pending_bssid, ETH_ALEN) == 0;
+ (!is_zero_ether_addr(bss->bssid) &&
+ (os_memcmp(bss->bssid, wpa_s->bssid, ETH_ALEN) == 0 ||
+ os_memcmp(bss->bssid, wpa_s->pending_bssid, ETH_ALEN) == 0));