]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix AP Extended Capability length determination
authorJouni Malinen <jouni@codeaurora.org>
Mon, 21 Oct 2019 15:11:30 +0000 (18:11 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 25 Oct 2019 13:03:37 +0000 (16:03 +0300)
The IE minimum length determination in hostapd_eid_ext_capab() was not
fully up to date with the hostapd_ext_capab_byte() conditions. This
could result in omitting some of the capability octets depending on
configuration. Fix this by adding the missing conditions.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/ieee802_11_shared.c

index f24963e16d879ac55859e69ebad214b4c0ea1f41..0b828e96f3e56f7ab970bfb8687c1bbeed2ad88e 100644 (file)
@@ -400,14 +400,22 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
        u8 *pos = eid;
        u8 len = 0, i;
 
-       if (hapd->conf->tdls & (TDLS_PROHIBIT | TDLS_PROHIBIT_CHAN_SWITCH))
+       if (hapd->conf->qos_map_set_len ||
+           (hapd->conf->tdls & (TDLS_PROHIBIT | TDLS_PROHIBIT_CHAN_SWITCH)))
                len = 5;
-       if (len < 4 && hapd->conf->interworking)
+       if (len < 4 &&
+           (hapd->conf->time_advertisement == 2 || hapd->conf->interworking))
                len = 4;
-       if (len < 3 && hapd->conf->wnm_sleep_mode)
+       if (len < 3 &&
+           (hapd->conf->wnm_sleep_mode || hapd->conf->bss_transition))
                len = 3;
-       if (len < 1 && hapd->iconf->obss_interval)
+       if (len < 1 &&
+           (hapd->iconf->obss_interval ||
+            (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)))
                len = 1;
+       if (len < 2 &&
+           (hapd->conf->proxy_arp || hapd->conf->coloc_intf_reporting))
+               len = 2;
        if (len < 7 && hapd->conf->ssid.utf8_ssid)
                len = 7;
        if (len < 9 &&