aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wpa_supplicant/blacklist.c9
-rw-r--r--wpa_supplicant/events.c5
2 files changed, 13 insertions, 1 deletions
diff --git a/wpa_supplicant/blacklist.c b/wpa_supplicant/blacklist.c
index fa8014c..2e01e7f 100644
--- a/wpa_supplicant/blacklist.c
+++ b/wpa_supplicant/blacklist.c
@@ -23,6 +23,9 @@ struct wpa_blacklist * wpa_blacklist_get(struct wpa_supplicant *wpa_s,
{
struct wpa_blacklist *e;
+ if (wpa_s == NULL || bssid == NULL)
+ return NULL;
+
e = wpa_s->blacklist;
while (e) {
if (os_memcmp(e->bssid, bssid, ETH_ALEN) == 0)
@@ -54,6 +57,9 @@ int wpa_blacklist_add(struct wpa_supplicant *wpa_s, const u8 *bssid)
{
struct wpa_blacklist *e;
+ if (wpa_s == NULL || bssid == NULL)
+ return -1;
+
e = wpa_blacklist_get(wpa_s, bssid);
if (e) {
e->count++;
@@ -87,6 +93,9 @@ int wpa_blacklist_del(struct wpa_supplicant *wpa_s, const u8 *bssid)
{
struct wpa_blacklist *e, *prev = NULL;
+ if (wpa_s == NULL || bssid == NULL)
+ return -1;
+
e = wpa_s->blacklist;
while (e) {
if (os_memcmp(e->bssid, bssid, ETH_ALEN) == 0) {
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 34300e4..4b1d992 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2553,7 +2553,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
wpa_s->reassociate = 1;
if (wpa_s->p2p_group_interface == NOT_P2P_GROUP_INTERFACE) {
- wpa_blacklist_add(wpa_s, data->assoc_reject.bssid);
+ const u8 *bl_bssid = data->assoc_reject.bssid;
+ if (!bl_bssid || is_zero_ether_addr(bl_bssid))
+ bl_bssid = wpa_s->pending_bssid;
+ wpa_blacklist_add(wpa_s, bl_bssid);
wpa_supplicant_req_scan(wpa_s, 0, 0);
} else {
wpa_supplicant_req_scan(wpa_s, 1, 0);