cfg80211: allow setting TXQ parameters only in AP mode
authorJohannes Berg <johannes.berg@intel.com>
Thu, 3 Nov 2011 13:50:13 +0000 (14:50 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Nov 2011 18:19:14 +0000 (13:19 -0500)
In other modes the parameters should not be set.
Right now, mac80211 will set them, even if the
user asked for setting them on VLANs which the
driver doesn't know about, causing all kinds of
trouble.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/nl80211.c

index b587857a9d7d17fb02f87be44a75c2fe59958d23..b3a476fe82725f738f5215b32cdf2296970451d2 100644 (file)
@@ -1252,6 +1252,12 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
                        goto bad_res;
                }
 
+               if (netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
+                   netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) {
+                       result = -EINVAL;
+                       goto bad_res;
+               }
+
                nla_for_each_nested(nl_txq_params,
                                    info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS],
                                    rem_txq_params) {