aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-19 20:00:10 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-19 20:00:10 (GMT)
commit57f7d03f91d317c512c403ee4d625f3379b524b6 (patch)
treeebd375bfa1a21b8a3dccf6531ff50061d15981a9 /wlantest/bss.c
parentfbdd21327e51dce89a8d5b67cb0fb8d1c118d130 (diff)
downloadhostap-57f7d03f91d317c512c403ee4d625f3379b524b6.zip
hostap-57f7d03f91d317c512c403ee4d625f3379b524b6.tar.gz
hostap-57f7d03f91d317c512c403ee4d625f3379b524b6.tar.bz2
wlantest: Do not add new BSS/STA entries based on ctrl commands
Introduce bss_find()/sta_find() as an alternative bss_get()/sta_get() command that do not allocate new BSS/STA entry if no existing entry is found.
Diffstat (limited to 'wlantest/bss.c')
-rw-r--r--wlantest/bss.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/wlantest/bss.c b/wlantest/bss.c
index 20e4f20..b3a7441 100644
--- a/wlantest/bss.c
+++ b/wlantest/bss.c
@@ -21,18 +21,30 @@
#include "wlantest.h"
-struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid)
+struct wlantest_bss * bss_find(struct wlantest *wt, const u8 *bssid)
{
struct wlantest_bss *bss;
- if (bssid[0] & 0x01)
- return NULL; /* Skip group addressed frames */
-
dl_list_for_each(bss, &wt->bss, struct wlantest_bss, list) {
if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0)
return bss;
}
+ return NULL;
+}
+
+
+struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid)
+{
+ struct wlantest_bss *bss;
+
+ if (bssid[0] & 0x01)
+ return NULL; /* Skip group addressed frames */
+
+ bss = bss_find(wt, bssid);
+ if (bss)
+ return bss;
+
bss = os_zalloc(sizeof(*bss));
if (bss == NULL)
return NULL;