Skip to contentSkip to conversation

cfg80211: verify format of uAPSD information

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

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: verify format of uAPSD information

From: Johannes Berg <[email protected]>

The format is intended to be like the subfields
in the QoS Info field, verify that is the case.

---
 net/wireless/nl80211.c |    5 +++++
 1 file changed, 5 insertions(+)
net/wireless/nl80211.c +5 -0
@@ -2611,10 +2611,15 @@ static int nl80211_new_station(struct sk
 		if (tb[NL80211_STA_WME_UAPSD_QUEUES])
 			params.uapsd_queues =
 			     nla_get_u8(tb[NL80211_STA_WME_UAPSD_QUEUES]);
+		if (params.uapsd_queues & ~IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK)
+			return -EINVAL;
 
 		if (tb[NL80211_STA_WME_MAX_SP])
 			params.max_sp =
 			     nla_get_u8(tb[NL80211_STA_WME_MAX_SP]);
+
+		if (params.max_sp & ~IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK)
+			return -EINVAL;
 	}
 
 	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&