aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ap-mgmt-fuzzer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-04-28 23:10:24 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-03 15:26:50 (GMT)
commitf79a5fa0068d7c770b2631e3030bca07892f99fe (patch)
tree55e8c8a1cabf613d949df25d1968ff73ed20893b /tests/ap-mgmt-fuzzer
parent6838452db835afee0573cbaf435962cfd3321ec6 (diff)
downloadhostap-f79a5fa0068d7c770b2631e3030bca07892f99fe.zip
hostap-f79a5fa0068d7c770b2631e3030bca07892f99fe.tar.gz
hostap-f79a5fa0068d7c770b2631e3030bca07892f99fe.tar.bz2
tests: Add a STA entry for ap-mgmt-fuzzer
This increases the coverage for AP mode management frame fuzzing by allowing number of additional Action frame code paths to be executed. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests/ap-mgmt-fuzzer')
-rw-r--r--tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c b/tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c
index a9e1975..dd06144 100644
--- a/tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c
+++ b/tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c
@@ -12,6 +12,7 @@
#include "utils/eloop.h"
#include "ap/hostapd.h"
#include "ap/ieee802_11.h"
+#include "ap/sta_info.h"
const struct wpa_driver_ops *const wpa_drivers[] =
@@ -59,6 +60,7 @@ out:
static int init_hapd(struct arg_ctx *ctx)
{
struct hostapd_data *hapd = &ctx->hapd;
+ struct sta_info *sta;
hapd->driver = &ctx->driver;
os_memcpy(hapd->own_addr, "\x02\x00\x00\x00\x03\x00", ETH_ALEN);
@@ -70,6 +72,10 @@ static int init_hapd(struct arg_ctx *ctx)
hapd->conf = hapd->iconf->bss[0];
hostapd_config_defaults_bss(hapd->conf);
+ sta = ap_sta_add(hapd, (u8 *) "\x02\x00\x00\x00\x00\x00");
+ if (sta)
+ sta->flags |= WLAN_STA_ASSOC | WLAN_STA_WMM;
+
return 0;
}
@@ -105,6 +111,7 @@ int main(int argc, char *argv[])
wpa_printf(MSG_DEBUG, "Starting eloop");
eloop_run();
wpa_printf(MSG_DEBUG, "eloop done");
+ hostapd_free_stas(&ctx.hapd);
ret = 0;
fail: