Skip to contentSkip to conversation

cfg80211: allow setting TXQ parameters only in AP mode

PATCH New Johannes Berg 1 participant 1 message Nov 3, 2011 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: allow setting TXQ parameters only in AP mode

From: Johannes Berg <[email protected]>

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.

---
 net/wireless/nl80211.c |    6 ++++++
 1 file changed, 6 insertions(+)
net/wireless/nl80211.c +6 -0
@@ -1252,6 +1252,12 @@ static int nl80211_set_wiphy(struct sk_b
 			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) {