]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Redirect more frames with ext_mgmt_frame_handling=1
authorJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 09:51:38 +0000 (11:51 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 15:15:12 +0000 (17:15 +0200)
This allows Action frames from not-associated stations to be processed
by external test tools.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/drv_callbacks.c
src/ap/ieee802_11.c

index 6fb1056622833962603d370f3756ee521458b6da..3318f7a58327077793c322ba18cbcfed3ac1f353 100644 (file)
@@ -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)
index 3e704e5618dcaa687ea53c31826f4c4e744a4434..c97cef1307f36c74fc8ca1e05a905c88653ebaa8 100644 (file)
@@ -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;