TDLS: Use WMM IE for propagating peer WMM capability
authorArik Nemtsov <arik@wizery.com>
Mon, 29 Sep 2014 18:47:53 +0000 (20:47 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 3 Oct 2014 08:52:56 +0000 (11:52 +0300)
Relying on qos qosinfo is not enough, as it can be 0 for WMM enabled
peers that don't support U-APSD. Further, some peers don't even contain
this IE (Google Nexus 5), but do contain the WMM IE during setup.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
src/rsn_supp/tdls.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_i.h
wpa_supplicant/wpas_glue.c

index 4ea781b..8cb19a2 100644 (file)
@@ -1721,8 +1721,8 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
                                       peer->supp_rates, peer->supp_rates_len,
                                       peer->ht_capabilities,
                                       peer->vht_capabilities,
-                                      peer->qos_info, peer->ext_capab,
-                                      peer->ext_capab_len,
+                                      peer->qos_info, peer->wmm_capable,
+                                      peer->ext_capab, peer->ext_capab_len,
                                       peer->supp_channels,
                                       peer->supp_channels_len,
                                       peer->supp_oper_classes,
@@ -1867,7 +1867,7 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
                           "TDLS setup - send own request");
                peer->initiator = 1;
                wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL,
-                                       NULL, 0, NULL, 0, NULL, 0, NULL, 0);
+                                       NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0);
                wpa_tdls_send_tpk_m1(sm, peer);
        }
 
@@ -2605,7 +2605,7 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr)
 
        /* add the peer to the driver as a "setup in progress" peer */
        if (wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL,
-                                   NULL, 0, NULL, 0, NULL, 0, NULL, 0)) {
+                                   NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0)) {
                wpa_tdls_disable_peer_link(sm, peer);
                return -1;
        }
index e7c5569..63032b0 100644 (file)
@@ -62,7 +62,7 @@ struct wpa_sm_ctx {
                                size_t supp_rates_len,
                                const struct ieee80211_ht_capabilities *ht_capab,
                                const struct ieee80211_vht_capabilities *vht_capab,
-                               u8 qosinfo, const u8 *ext_capab,
+                               u8 qosinfo, int wmm, const u8 *ext_capab,
                                size_t ext_capab_len, const u8 *supp_channels,
                                size_t supp_channels_len,
                                const u8 *supp_oper_classes,
index 845a1b6..839b545 100644 (file)
@@ -293,16 +293,16 @@ wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add,
                        size_t supp_rates_len,
                        const struct ieee80211_ht_capabilities *ht_capab,
                        const struct ieee80211_vht_capabilities *vht_capab,
-                       u8 qosinfo, const u8 *ext_capab, size_t ext_capab_len,
-                       const u8 *supp_channels, size_t supp_channels_len,
-                       const u8 *supp_oper_classes,
+                       u8 qosinfo, int wmm, const u8 *ext_capab,
+                       size_t ext_capab_len, const u8 *supp_channels,
+                       size_t supp_channels_len, const u8 *supp_oper_classes,
                        size_t supp_oper_classes_len)
 {
        if (sm->ctx->tdls_peer_addset)
                return sm->ctx->tdls_peer_addset(sm->ctx->ctx, addr, add,
                                                 aid, capability, supp_rates,
                                                 supp_rates_len, ht_capab,
-                                                vht_capab, qosinfo,
+                                                vht_capab, qosinfo, wmm,
                                                 ext_capab, ext_capab_len,
                                                 supp_channels,
                                                 supp_channels_len,
index 896c256..38279b1 100644 (file)
@@ -602,7 +602,7 @@ static int wpa_supplicant_tdls_peer_addset(
        const u8 *supp_rates, size_t supp_rates_len,
        const struct ieee80211_ht_capabilities *ht_capab,
        const struct ieee80211_vht_capabilities *vht_capab,
-       u8 qosinfo, const u8 *ext_capab, size_t ext_capab_len,
+       u8 qosinfo, int wmm, const u8 *ext_capab, size_t ext_capab_len,
        const u8 *supp_channels, size_t supp_channels_len,
        const u8 *supp_oper_classes, size_t supp_oper_classes_len)
 {
@@ -617,10 +617,10 @@ static int wpa_supplicant_tdls_peer_addset(
        params.flags = WPA_STA_TDLS_PEER | WPA_STA_AUTHORIZED;
 
        /*
-        * TDLS Setup frames do not contain WMM IEs, hence need to depend on
-        * qosinfo to check if the peer is WMM capable.
+        * Don't rely only on qosinfo for WMM capability. It may be 0 even when
+        * present. Allow the WMM IE to also indicate QoS support.
         */
-       if (qosinfo)
+       if (wmm || qosinfo)
                params.flags |= WPA_STA_WMM;
 
        params.ht_capabilities = ht_capab;