mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
Add parameter checking and error reporting to wpa_blacklist API
Signed-off-by: Sasha Levitskiy <sanek@google.com>
This commit is contained in:
parent
b363121a20
commit
5ff2c7faed
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user