PERFORCE change 65912 for review

Sam Leffler sam at FreeBSD.org
Fri Nov 26 16:56:20 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=65912

Change 65912 by sam at sam_ebb on 2004/11/27 00:56:04

	o correct wme params ie creation
	o correct wme params ie length check on rx
	o make beacon space allocation for wpa and wme ie's
	  conditional based on device capabilities

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_input.c#18 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_output.c#12 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#18 (text+ko) ====

@@ -1551,7 +1551,7 @@
 	u_int len = frm[1], qosinfo;
 	int i;
 
-	if (len < sizeof(struct ieee80211_wme_param)) {
+	if (len < sizeof(struct ieee80211_wme_param)-2) {
 		IEEE80211_DPRINTF(ic, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WME,
 			"%s: length %u too short\n", __func__, len);
 		return 0;

==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#12 (text+ko) ====

@@ -842,7 +842,7 @@
 {
 	static const struct ieee80211_wme_info info = {
 		.wme_id		= IEEE80211_ELEMID_VENDOR,
-		.wme_len	= sizeof(struct ieee80211_wme_info),
+		.wme_len	= sizeof(struct ieee80211_wme_info) - 2,
 		.wme_oui	= { WME_OUI_BYTES },
 		.wme_type	= WME_OUI_TYPE,
 		.wme_subtype	= WME_INFO_OUI_SUBTYPE,
@@ -868,7 +868,7 @@
 	/* NB: this works 'cuz a param has an info at the front */
 	static const struct ieee80211_wme_info param = {
 		.wme_id		= IEEE80211_ELEMID_VENDOR,
-		.wme_len	= sizeof(struct ieee80211_wme_param),
+		.wme_len	= sizeof(struct ieee80211_wme_param) - 2,
 		.wme_oui	= { WME_OUI_BYTES },
 		.wme_type	= WME_OUI_TYPE,
 		.wme_subtype	= WME_PARAM_OUI_SUBTYPE,
@@ -879,8 +879,8 @@
 	memcpy(frm, &param, sizeof(param));
 	frm += __offsetof(struct ieee80211_wme_info, wme_info);
 	*frm++ = wme->wme_bssChanParams.cap_info;	/* AC info */
-	*frm++ = 0;				/* reserved field */
-	for (i = 0; i <= WME_NUM_AC; i++) {
+	*frm++ = 0;					/* reserved field */
+	for (i = 0; i < WME_NUM_AC; i++) {
 		const struct wmeParams *ac =
 		       &wme->wme_bssChanParams.cap_wmeParams[i];
 		*frm++ = SM(i, WME_PARAM_ACI)
@@ -1329,7 +1329,10 @@
 		 + 2 + 4 + ic->ic_tim_len		/* DTIM/IBSSPARMS */
 		 + 2 + 1				/* ERP */
 	         + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)
-		 + 2*sizeof(struct ieee80211_ie_wpa)	/* WPA 1+2 */
+		 + (ic->ic_caps & IEEE80211_C_WME ?	/* WME */
+			sizeof(struct ieee80211_wme_param) : 0)
+		 + (ic->ic_caps & IEEE80211_C_WPA ?	/* WPA 1+2 */
+			2*sizeof(struct ieee80211_ie_wpa) : 0)
 		 ;
 	m = ieee80211_getmgtframe(&frm, pktlen);
 	if (m == NULL) {


More information about the p4-projects mailing list