]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update define name for Protected Frame field in Frame Control field
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Mon, 19 Jan 2026 21:06:02 +0000 (23:06 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 19 Jan 2026 21:06:02 +0000 (23:06 +0200)
The WEP field was renamed already in IEEE Std 802.11i-2004 to the
Protected Frame field, so better rename the define for this field use
the current name after 20 years..

Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
src/ap/ieee802_11.c
src/common/ieee802_11_defs.h
wlantest/ccmp.c
wlantest/rx_data.c
wlantest/rx_mgmt.c

index 24ef8b75f8ed3d6a13f5c1673b8a9d6641a64c5e..a3167300743c58545d3fb826b22cbcc812eff831 100644 (file)
@@ -3320,10 +3320,10 @@ static void handle_auth(struct hostapd_data *hapd,
                challenge = &mgmt->u.auth.variable[2];
 
        wpa_printf(MSG_DEBUG, "authentication: STA=" MACSTR " auth_alg=%d "
-                  "auth_transaction=%d status_code=%d wep=%d%s "
+                  "auth_transaction=%d status_code=%d protected=%d%s "
                   "seq_ctrl=0x%x%s%s",
                   MAC2STR(sa), auth_alg, auth_transaction,
-                  status_code, !!(fc & WLAN_FC_ISWEP),
+                  status_code, !!(fc & WLAN_FC_PROTECTED),
                   challenge ? " challenge" : "",
                   seq_ctrl, (fc & WLAN_FC_RETRY) ? " retry" : "",
                   from_queue ? " (from queue)" : "");
@@ -3663,7 +3663,7 @@ static void handle_auth(struct hostapd_data *hapd,
 #ifndef CONFIG_NO_RC4
        case WLAN_AUTH_SHARED_KEY:
                resp = auth_shared_key(hapd, sta, auth_transaction, challenge,
-                                      fc & WLAN_FC_ISWEP);
+                                      fc & WLAN_FC_PROTECTED);
                if (resp != 0)
                        wpa_printf(MSG_DEBUG,
                                   "auth_shared_key() failed: status=%d", resp);
@@ -6625,7 +6625,7 @@ static int handle_action(struct hostapd_data *hapd,
        }
 
        if (sta && (sta->flags & WLAN_STA_MFP) &&
-           !(mgmt->frame_control & host_to_le16(WLAN_FC_ISWEP)) &&
+           !(mgmt->frame_control & host_to_le16(WLAN_FC_PROTECTED)) &&
            robust_action_frame(mgmt->u.action.category)) {
                hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_DEBUG,
index 89f0a1bf8e5bb9ae1f7fa5103a5b2d06a0bf6ccf..b5857c00a42577a6ffcd0832aca5cb8cc3016c4e 100644 (file)
@@ -21,7 +21,7 @@
 #define WLAN_FC_RETRY          0x0800
 #define WLAN_FC_PWRMGT         0x1000
 #define WLAN_FC_MOREDATA       0x2000
-#define WLAN_FC_ISWEP          0x4000
+#define WLAN_FC_PROTECTED      0x4000
 #define WLAN_FC_HTC            0x8000
 
 #define WLAN_FC_S1G_BEACON_NEXT_TBTT   0x0100
index d6594b9ca28e32bd2f956ac092b57b968a4c3e6f..6acd75c823f46339f0c8b0872e480589324baa73 100644 (file)
@@ -46,7 +46,7 @@ static void ccmp_aad_nonce(const struct ieee80211_hdr *hdr, const u8 *data,
                nonce[0] |= 0x10; /* Management */
 
        fc &= ~(WLAN_FC_RETRY | WLAN_FC_PWRMGT | WLAN_FC_MOREDATA);
-       fc |= WLAN_FC_ISWEP;
+       fc |= WLAN_FC_PROTECTED;
        WPA_PUT_LE16(aad, fc);
        pos = aad + 2;
        os_memcpy(pos, hdr->addr1, 3 * ETH_ALEN);
@@ -223,7 +223,7 @@ u8 * ccmp_encrypt(const u8 *tk, u8 *frame, size_t len, size_t hdrlen,
 
        os_memcpy(crypt, frame, hdrlen);
        hdr = (struct ieee80211_hdr *) crypt;
-       hdr->frame_control |= host_to_le16(WLAN_FC_ISWEP);
+       hdr->frame_control |= host_to_le16(WLAN_FC_PROTECTED);
        pos = crypt + hdrlen;
        *pos++ = pn[5]; /* PN0 */
        *pos++ = pn[4]; /* PN1 */
@@ -356,7 +356,7 @@ u8 * ccmp_256_encrypt(const u8 *tk, u8 *frame, size_t len, size_t hdrlen,
 
        os_memcpy(crypt, frame, hdrlen);
        hdr = (struct ieee80211_hdr *) crypt;
-       hdr->frame_control |= host_to_le16(WLAN_FC_ISWEP);
+       hdr->frame_control |= host_to_le16(WLAN_FC_PROTECTED);
        pos = crypt + hdrlen;
        *pos++ = pn[5]; /* PN0 */
        *pos++ = pn[4]; /* PN1 */
index 4b0a2244e82b9fe8e6ed8733007c49c67a5951eb..2c1652e41bb5ee77e4beb5ed1c89e5ca196f7b07 100644 (file)
@@ -768,7 +768,7 @@ static void rx_data_bss(struct wlantest *wt, const struct ieee80211_hdr *hdr,
                        const u8 *src, const u8 *data, size_t len)
 {
        u16 fc = le_to_host16(hdr->frame_control);
-       int prot = !!(fc & WLAN_FC_ISWEP);
+       int prot = !!(fc & WLAN_FC_PROTECTED);
 
        if (qos) {
                u8 ack = (qos[0] & 0x60) >> 5;
@@ -937,7 +937,7 @@ void rx_data(struct wlantest *wt, const u8 *data, size_t len)
                           MACSTR " BSSID=" MACSTR,
                           data_stype(WLAN_FC_GET_STYPE(fc)),
                           fc & WLAN_FC_PWRMGT ? " PwrMgt" : "",
-                          fc & WLAN_FC_ISWEP ? " Prot" : "",
+                          fc & WLAN_FC_PROTECTED ? " Prot" : "",
                           MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                           MAC2STR(hdr->addr3));
                add_direct_link(wt, hdr->addr3, hdr->addr1, hdr->addr2);
@@ -949,7 +949,7 @@ void rx_data(struct wlantest *wt, const u8 *data, size_t len)
                           " BSSID=" MACSTR " SA=" MACSTR,
                           data_stype(WLAN_FC_GET_STYPE(fc)),
                           fc & WLAN_FC_PWRMGT ? " PwrMgt" : "",
-                          fc & WLAN_FC_ISWEP ? " Prot" : "",
+                          fc & WLAN_FC_PROTECTED ? " Prot" : "",
                           MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                           MAC2STR(hdr->addr3));
                add_ap_path(wt, hdr->addr2, hdr->addr1, hdr->addr3);
@@ -961,7 +961,7 @@ void rx_data(struct wlantest *wt, const u8 *data, size_t len)
                           " SA=" MACSTR " DA=" MACSTR,
                           data_stype(WLAN_FC_GET_STYPE(fc)),
                           fc & WLAN_FC_PWRMGT ? " PwrMgt" : "",
-                          fc & WLAN_FC_ISWEP ? " Prot" : "",
+                          fc & WLAN_FC_PROTECTED ? " Prot" : "",
                           MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                           MAC2STR(hdr->addr3));
                add_ap_path(wt, hdr->addr1, hdr->addr3, hdr->addr2);
@@ -973,7 +973,7 @@ void rx_data(struct wlantest *wt, const u8 *data, size_t len)
                           MACSTR " DA=" MACSTR " SA=" MACSTR,
                           data_stype(WLAN_FC_GET_STYPE(fc)),
                           fc & WLAN_FC_PWRMGT ? " PwrMgt" : "",
-                          fc & WLAN_FC_ISWEP ? " Prot" : "",
+                          fc & WLAN_FC_PROTECTED ? " Prot" : "",
                           MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                           MAC2STR(hdr->addr3),
                           MAC2STR((const u8 *) (hdr + 1)));
index be4d53c6dafc5c1debc589ad26db16029f1f03d0..c79b06c1837e4afcfab78ca29b7cc06d7b320963 100644 (file)
@@ -1283,9 +1283,9 @@ static void rx_mgmt_deauth(struct wlantest *wt, const u8 *data, size_t len,
                        sta->counters[WLANTEST_STA_COUNTER_DEAUTH_RX_AWAKE]++;
 
                fc = le_to_host16(mgmt->frame_control);
-               if (!(fc & WLAN_FC_ISWEP) && reason == 6)
+               if (!(fc & WLAN_FC_PROTECTED) && reason == 6)
                        sta->counters[WLANTEST_STA_COUNTER_DEAUTH_RX_RC6]++;
-               else if (!(fc & WLAN_FC_ISWEP) && reason == 7)
+               else if (!(fc & WLAN_FC_PROTECTED) && reason == 7)
                        sta->counters[WLANTEST_STA_COUNTER_DEAUTH_RX_RC7]++;
        } else
                sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DEAUTH_TX :
@@ -2856,9 +2856,9 @@ static void rx_mgmt_disassoc(struct wlantest *wt, const u8 *data, size_t len,
                                WLANTEST_STA_COUNTER_DISASSOC_RX_AWAKE]++;
 
                fc = le_to_host16(mgmt->frame_control);
-               if (!(fc & WLAN_FC_ISWEP) && reason == 6)
+               if (!(fc & WLAN_FC_PROTECTED) && reason == 6)
                        sta->counters[WLANTEST_STA_COUNTER_DISASSOC_RX_RC6]++;
-               else if (!(fc & WLAN_FC_ISWEP) && reason == 7)
+               else if (!(fc & WLAN_FC_PROTECTED) && reason == 7)
                        sta->counters[WLANTEST_STA_COUNTER_DISASSOC_RX_RC7]++;
        } else
                sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DISASSOC_TX :
@@ -3953,11 +3953,11 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
                   " #%u",
                   mgmt_stype(stype),
                   fc & WLAN_FC_PWRMGT ? " PwrMgt" : "",
-                  fc & WLAN_FC_ISWEP ? " Prot" : "",
+                  fc & WLAN_FC_PROTECTED ? " Prot" : "",
                   MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                   MAC2STR(hdr->addr3), wt->frame_num);
 
-       if ((fc & WLAN_FC_ISWEP) &&
+       if ((fc & WLAN_FC_PROTECTED) &&
            !(hdr->addr1[0] & 0x01) &&
            (stype == WLAN_FC_STYPE_DEAUTH ||
             stype == WLAN_FC_STYPE_DISASSOC ||
@@ -3972,7 +3972,7 @@ void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len)
                        valid = 0;
        }
 
-       if (!(fc & WLAN_FC_ISWEP) &&
+       if (!(fc & WLAN_FC_PROTECTED) &&
            !(hdr->addr1[0] & 0x01) &&
            (stype == WLAN_FC_STYPE_DEAUTH ||
             stype == WLAN_FC_STYPE_DISASSOC ||