nl80211: ignore HT/VHT capabilities without QoS/WMM
[pandora-kernel.git] / net / wireless / nl80211.c
index cb4168e..e1f73b6 100644 (file)
@@ -2650,6 +2650,14 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
        if (parse_station_flags(info, &params))
                return -EINVAL;
 
+       /* HT requires QoS, but if we don't have that just ignore HT/VHT
+        * as userspace might just pass through the capabilities from the IEs
+        * directly, rather than enforcing this restriction and returning an
+        * error in this case.
+        */
+       if (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_WME)))
+               params.ht_capa = NULL;
+
        /* parse WME attributes if sta is WME capable */
        if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
            (params.sta_flags_set & BIT(NL80211_STA_FLAG_WME)) &&