]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Send RM Enabled Capabilities element in (Re)Association Response frame
authorMarkus Theil <markus.theil@tu-ilmenau.de>
Fri, 24 Jan 2020 16:24:53 +0000 (17:24 +0100)
committerJouni Malinen <jouni@codeaurora.org>
Mon, 10 Feb 2020 04:51:42 +0000 (06:51 +0200)
(Re)Association Response frames should include radio measurement
capabilities in order to let stations know if they can, e.g., use
neighbor requests.

I tested this commit with a Samsung S8, which does not send neighbor
requests without this commit and sends them afterwards.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
src/ap/beacon.c
src/ap/ieee802_11.c
src/ap/ieee802_11.h

index 29c7e383de9cd1fff5f237f7054821bb0caca4c1..ecee27aa62b8c658902798b565e832bcc9d50691 100644 (file)
 
 #ifdef NEED_AP_MLME
 
-static u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid,
-                                        size_t len)
-{
-       size_t i;
-
-       for (i = 0; i < RRM_CAPABILITIES_IE_LEN; i++) {
-               if (hapd->conf->radio_measurements[i])
-                       break;
-       }
-
-       if (i == RRM_CAPABILITIES_IE_LEN || len < 2 + RRM_CAPABILITIES_IE_LEN)
-               return eid;
-
-       *eid++ = WLAN_EID_RRM_ENABLED_CAPABILITIES;
-       *eid++ = RRM_CAPABILITIES_IE_LEN;
-       os_memcpy(eid, hapd->conf->radio_measurements, RRM_CAPABILITIES_IE_LEN);
-
-       return eid + RRM_CAPABILITIES_IE_LEN;
-}
-
-
 static u8 * hostapd_eid_bss_load(struct hostapd_data *hapd, u8 *eid, size_t len)
 {
        if (len < 2 + 5)
index c93872da418702182e7c431bcd86a4710cc4aca9..625e10b4b835dcb43015000c28589ce9a9ffcfe1 100644 (file)
@@ -199,6 +199,27 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
 }
 
 
+u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid,
+                                 size_t len)
+{
+       size_t i;
+
+       for (i = 0; i < RRM_CAPABILITIES_IE_LEN; i++) {
+               if (hapd->conf->radio_measurements[i])
+                       break;
+       }
+
+       if (i == RRM_CAPABILITIES_IE_LEN || len < 2 + RRM_CAPABILITIES_IE_LEN)
+               return eid;
+
+       *eid++ = WLAN_EID_RRM_ENABLED_CAPABILITIES;
+       *eid++ = RRM_CAPABILITIES_IE_LEN;
+       os_memcpy(eid, hapd->conf->radio_measurements, RRM_CAPABILITIES_IE_LEN);
+
+       return eid + RRM_CAPABILITIES_IE_LEN;
+}
+
+
 u16 hostapd_own_capab_info(struct hostapd_data *hapd)
 {
        int capab = WLAN_CAPABILITY_ESS;
@@ -3684,6 +3705,9 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
        /* Extended supported rates */
        p = hostapd_eid_ext_supp_rates(hapd, p);
 
+       /* Radio measurement capabilities */
+       p = hostapd_eid_rm_enabled_capab(hapd, p, buf + buflen - p);
+
 #ifdef CONFIG_MBO
        if (status_code == WLAN_STATUS_DENIED_POOR_CHANNEL_CONDITIONS &&
            rssi != 0) {
index 0983d4c8beb2634a33cf60adb0d697a55a61c97d..635fc8cd64195a4a6eb30e8f04f146b51c06aa46 100644 (file)
@@ -49,6 +49,8 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_qos_map_set(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid);
+u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid,
+                                 size_t len);
 u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid);