aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/sta.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/sta.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/sta.c')
-rw-r--r--wlantest/sta.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/wlantest/sta.c b/wlantest/sta.c
index f264d36..bec494d 100644
--- a/wlantest/sta.c
+++ b/wlantest/sta.c
@@ -20,18 +20,30 @@
#include "wlantest.h"
-struct wlantest_sta * sta_get(struct wlantest_bss *bss, const u8 *addr)
+struct wlantest_sta * sta_find(struct wlantest_bss *bss, const u8 *addr)
{
struct wlantest_sta *sta;
- if (addr[0] & 0x01)
- return NULL; /* Skip group addressed frames */
-
dl_list_for_each(sta, &bss->sta, struct wlantest_sta, list) {
if (os_memcmp(sta->addr, addr, ETH_ALEN) == 0)
return sta;
}
+ return NULL;
+}
+
+
+struct wlantest_sta * sta_get(struct wlantest_bss *bss, const u8 *addr)
+{
+ struct wlantest_sta *sta;
+
+ if (addr[0] & 0x01)
+ return NULL; /* Skip group addressed frames */
+
+ sta = sta_find(bss, addr);
+ if (sta)
+ return sta;
+
sta = os_zalloc(sizeof(*sta));
if (sta == NULL)
return NULL;