]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HE: Fix HE operation field size
authorJohn Crispin <john@phrozen.org>
Thu, 25 Apr 2019 14:57:48 +0000 (16:57 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 25 Apr 2019 20:51:04 +0000 (23:51 +0300)
The current code will always use the size required when all optional
elements are present. This will cause the Linux kernel to consider the
field to be malformed if the elements are not actually flagged as being
present.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
src/ap/ieee802_11_he.c

index efa7013350acd9cbf40ef0e286e4b4ea89bb6069..8798ada32bfca1cdecc6d06b06261a2921c54ad9 100644 (file)
@@ -61,12 +61,13 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
 {
        struct ieee80211_he_operation *oper;
        u8 *pos = eid;
+       int oper_size = 6;
 
        if (!hapd->iface->current_mode)
                return eid;
 
        *pos++ = WLAN_EID_EXTENSION;
-       *pos++ = 1 + sizeof(struct ieee80211_he_operation);
+       *pos++ = 1 + oper_size;
        *pos++ = WLAN_EID_EXT_HE_OPERATION;
 
        oper = (struct ieee80211_he_operation *) pos;
@@ -92,7 +93,7 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
 
        /* TODO: conditional MaxBSSID Indicator subfield */
 
-       pos += sizeof(*oper);
+       pos += oper_size;
 
        return pos;
 }