]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Process Action No Ack frames like Action frames
authorJouni Malinen <j@w1.fi>
Sun, 7 Feb 2021 10:00:12 +0000 (12:00 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Feb 2021 10:00:12 +0000 (12:00 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/ieee802_11_defs.h
wlantest/inject.c
wlantest/rx_mgmt.c

index 8cc86146b425ed24db6fbcd2ce331f0196b65835..4c8f372913d55a61b73457bea950fcc68d6fa0dc 100644 (file)
@@ -50,6 +50,7 @@
 #define WLAN_FC_STYPE_AUTH             11
 #define WLAN_FC_STYPE_DEAUTH           12
 #define WLAN_FC_STYPE_ACTION           13
+#define WLAN_FC_STYPE_ACTION_NO_ACK    14
 
 /* control */
 #define WLAN_FC_STYPE_PSPOLL           10
index 54a055433e46ec5f82459bb49b19dffb8ccef2d1..399f1a3c070739d1ddb6af0fa0e322c4668f2512 100644 (file)
@@ -68,7 +68,8 @@ static int is_robust_mgmt(u8 *frame, size_t len)
        stype = WLAN_FC_GET_STYPE(fc);
        if (stype == WLAN_FC_STYPE_DEAUTH || stype == WLAN_FC_STYPE_DISASSOC)
                return 1;
-       if (stype == WLAN_FC_STYPE_ACTION) {
+       if (stype == WLAN_FC_STYPE_ACTION ||
+           stype == WLAN_FC_STYPE_ACTION_NO_ACK) {
                if (len < 25)
                        return 0;
                if (mgmt->u.action.category != WLAN_ACTION_PUBLIC)
index 2b05807529e5f2c992f95612a86d8ea4b25878cd..92d66b0f8b419999c304da8af3d4edc218df42ce 100644 (file)
@@ -51,6 +51,8 @@ static const char * mgmt_stype(u16 stype)
                return "DEAUTH";
        case WLAN_FC_STYPE_ACTION:
                return "ACTION";
+       case WLAN_FC_STYPE_ACTION_NO_ACK:
+               return "ACTION-NO-ACK";
        }
        return "??";
 }
@@ -2062,7 +2064,8 @@ static int check_bip(struct wlantest *wt, const u8 *data, size_t len)
        fc = le_to_host16(mgmt->frame_control);
        stype = WLAN_FC_GET_STYPE(fc);
 
-       if (stype == WLAN_FC_STYPE_ACTION) {
+       if (stype == WLAN_FC_STYPE_ACTION ||
+           stype == WLAN_FC_STYPE_ACTION_NO_ACK) {
                if (len < 24 + 1)
                        return 0;
                if (mgmt->u.action.category == WLAN_ACTION_PUBLIC)
@@ -2291,7 +2294,8 @@ static int check_mgmt_ccmp(struct wlantest *wt, const u8 *data, size_t len)
        mgmt = (const struct ieee80211_mgmt *) data;
        fc = le_to_host16(mgmt->frame_control);
 
-       if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION) {
+       if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION ||
+           WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK) {
                if (len > 24 &&
                    mgmt->u.action.category == WLAN_ACTION_PUBLIC)
                        return 0; /* Not a robust management frame */
@@ -2310,7 +2314,8 @@ static int check_mgmt_ccmp(struct wlantest *wt, const u8 *data, size_t len)
        if ((bss->rsn_capab & WPA_CAPABILITY_MFPC) &&
            (sta->rsn_capab & WPA_CAPABILITY_MFPC) &&
            (sta->state == STATE3 ||
-            WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION)) {
+            WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION ||
+            WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK)) {
                add_note(wt, MSG_INFO, "Robust individually-addressed "
                         "management frame sent without CCMP by "
                         MACSTR, MAC2STR(mgmt->sa));
@@ -2340,7 +2345,8 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
        if ((hdr->addr1[0] & 0x01) &&
            (stype == WLAN_FC_STYPE_DEAUTH ||
             stype == WLAN_FC_STYPE_DISASSOC ||
-            stype == WLAN_FC_STYPE_ACTION)) {
+            stype == WLAN_FC_STYPE_ACTION ||
+            stype == WLAN_FC_STYPE_ACTION_NO_ACK)) {
                if (check_bip(wt, data, len) < 0)
                        valid = 0;
        }
@@ -2360,7 +2366,8 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
            !(hdr->addr1[0] & 0x01) &&
            (stype == WLAN_FC_STYPE_DEAUTH ||
             stype == WLAN_FC_STYPE_DISASSOC ||
-            stype == WLAN_FC_STYPE_ACTION)) {
+            stype == WLAN_FC_STYPE_ACTION ||
+            stype == WLAN_FC_STYPE_ACTION_NO_ACK)) {
                decrypted = mgmt_ccmp_decrypt(wt, data, len, &dlen);
                if (decrypted) {
                        write_pcap_decrypted(wt, decrypted, dlen, NULL, 0);
@@ -2374,7 +2381,8 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
            !(hdr->addr1[0] & 0x01) &&
            (stype == WLAN_FC_STYPE_DEAUTH ||
             stype == WLAN_FC_STYPE_DISASSOC ||
-            stype == WLAN_FC_STYPE_ACTION)) {
+            stype == WLAN_FC_STYPE_ACTION ||
+            stype == WLAN_FC_STYPE_ACTION_NO_ACK)) {
                if (check_mgmt_ccmp(wt, data, len) < 0)
                        valid = 0;
        }
@@ -2410,6 +2418,9 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
        case WLAN_FC_STYPE_ACTION:
                rx_mgmt_action(wt, data, len, valid);
                break;
+       case WLAN_FC_STYPE_ACTION_NO_ACK:
+               rx_mgmt_action(wt, data, len, valid);
+               break;
        }
 
        os_free(decrypted);