From 5f7e1c06cd428888a2ed4fa763c5da37a873e422 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 2 Mar 2014 11:51:38 +0200 Subject: [PATCH] Redirect more frames with ext_mgmt_frame_handling=1 This allows Action frames from not-associated stations to be processed by external test tools. Signed-off-by: Jouni Malinen --- src/ap/drv_callbacks.c | 14 ++++++++++++++ src/ap/ieee802_11.c | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 6fb105662..3318f7a58 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -678,6 +678,20 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt) struct hostapd_frame_info fi; int ret; +#ifdef CONFIG_TESTING_OPTIONS + if (hapd->ext_mgmt_frame_handling) { + size_t hex_len = 2 * rx_mgmt->frame_len + 1; + char *hex = os_malloc(hex_len); + if (hex) { + wpa_snprintf_hex(hex, hex_len, rx_mgmt->frame, + rx_mgmt->frame_len); + wpa_msg(hapd->msg_ctx, MSG_INFO, "MGMT-RX %s", hex); + os_free(hex); + } + return 1; + } +#endif /* CONFIG_TESTING_OPTIONS */ + hdr = (const struct ieee80211_hdr *) rx_mgmt->frame; bssid = get_hdr_bssid(hdr, rx_mgmt->frame_len); if (bssid == NULL) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 3e704e561..c97cef130 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1738,19 +1738,6 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, u16 fc, stype; int ret = 0; -#ifdef CONFIG_TESTING_OPTIONS - if (hapd->ext_mgmt_frame_handling) { - size_t hex_len = 2 * len + 1; - char *hex = os_malloc(hex_len); - if (hex) { - wpa_snprintf_hex(hex, hex_len, buf, len); - wpa_msg(hapd->msg_ctx, MSG_INFO, "MGMT-RX %s", hex); - os_free(hex); - } - return 1; - } -#endif /* CONFIG_TESTING_OPTIONS */ - if (len < 24) return 0;