From owner-p4-projects@FreeBSD.ORG Sat Nov 27 00:56:20 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3229816A4D0; Sat, 27 Nov 2004 00:56:20 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A28C16A4CE for ; Sat, 27 Nov 2004 00:56:20 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD4D143D5A for ; Sat, 27 Nov 2004 00:56:19 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iAR0uJ0M062737 for ; Sat, 27 Nov 2004 00:56:19 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iAR0uJT2062734 for perforce@freebsd.org; Sat, 27 Nov 2004 00:56:19 GMT (envelope-from sam@freebsd.org) Date: Sat, 27 Nov 2004 00:56:19 GMT Message-Id: <200411270056.iAR0uJT2062734@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 65912 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Nov 2004 00:56:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=65912 Change 65912 by sam@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, ¶m, 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) {