From owner-p4-projects@FreeBSD.ORG Tue Dec 14 03:14:13 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0B0E916A4D0; Tue, 14 Dec 2004 03:14:13 +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 DC7F916A4CE for ; Tue, 14 Dec 2004 03:14:12 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC53543D60 for ; Tue, 14 Dec 2004 03:14:12 +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 iBE3ECfM001740 for ; Tue, 14 Dec 2004 03:14:12 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iBE3ECuG001737 for perforce@freebsd.org; Tue, 14 Dec 2004 03:14:12 GMT (envelope-from sam@freebsd.org) Date: Tue, 14 Dec 2004 03:14:12 GMT Message-Id: <200412140314.iBE3ECuG001737@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 67021 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: Tue, 14 Dec 2004 03:14:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=67021 Change 67021 by sam@sam_ebb on 2004/12/14 03:13:35 o fillin QoS header prior to enmic so it's available for TKIP o cleanup debug msg and add statistic for no default xmit key Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_output.c#25 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#25 (text+ko) ==== @@ -452,9 +452,10 @@ key = ieee80211_crypto_getkey(ic, eh.ether_dhost, ni); if (key == NULL && eh.ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_CRYPTO, - "[%s] no default transmit key\n", - ether_sprintf(ni->ni_macaddr)); - /* XXX statistic */ + "[%s] no default transmit key (%s) deftxkey %u\n", + ether_sprintf(ni->ni_macaddr), __func__, + ic->ic_def_txkey); + ic->ic_stats.is_tx_nodefkey++; } } else key = NULL; @@ -513,25 +514,6 @@ case IEEE80211_M_MONITOR: goto bad; } - if (eh.ether_type != htons(ETHERTYPE_PAE) || - (key != NULL && (ic->ic_flags & IEEE80211_F_WPA))) { - /* - * IEEE 802.1X: send EAPOL frames always in the clear. - * WPA/WPA2: encrypt EAPOL keys when pairwise keys are set. - */ - if (key != NULL) { - wh->i_fc[1] |= IEEE80211_FC1_WEP; - /* XXX do fragmentation */ - if (!ieee80211_crypto_enmic(ic, key, m)) { - IEEE80211_DPRINTF(ic, IEEE80211_MSG_OUTPUT, - "[%s] enmic failed, discard frame\n", - ether_sprintf(eh.ether_dhost)); - /* XXX statistic */ - goto bad; - } - } - } - if (ni->ni_flags & IEEE80211_NODE_QOS) { struct ieee80211_qosframe *qwh = (struct ieee80211_qosframe *) wh; @@ -554,6 +536,24 @@ htole16(ni->ni_txseqs[0] << IEEE80211_SEQ_SEQ_SHIFT); ni->ni_txseqs[0]++; } + if (eh.ether_type != htons(ETHERTYPE_PAE) || + (key != NULL && (ic->ic_flags & IEEE80211_F_WPA))) { + /* + * IEEE 802.1X: send EAPOL frames always in the clear. + * WPA/WPA2: encrypt EAPOL keys when pairwise keys are set. + */ + if (key != NULL) { + wh->i_fc[1] |= IEEE80211_FC1_WEP; + /* XXX do fragmentation */ + if (!ieee80211_crypto_enmic(ic, key, m)) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_OUTPUT, + "[%s] enmic failed, discard frame\n", + ether_sprintf(eh.ether_dhost)); + /* XXX statistic */ + goto bad; + } + } + } IEEE80211_NODE_STAT(ni, tx_data); IEEE80211_NODE_STAT_ADD(ni, tx_bytes, datalen);