From owner-p4-projects@FreeBSD.ORG Sat Feb 24 00:02:08 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 92FBF16A405; Sat, 24 Feb 2007 00:02:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D51416A402 for ; Sat, 24 Feb 2007 00:02:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 4B69A13C428 for ; Sat, 24 Feb 2007 00:02:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1O027fk038938 for ; Sat, 24 Feb 2007 00:02:07 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1O027Gw038930 for perforce@freebsd.org; Sat, 24 Feb 2007 00:02:07 GMT (envelope-from sam@freebsd.org) Date: Sat, 24 Feb 2007 00:02:07 GMT Message-Id: <200702240002.l1O027Gw038930@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 Cc: Subject: PERFORCE change 114935 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2007 00:02:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=114935 Change 114935 by sam@sam_ebb on 2007/02/24 00:01:25 promote KEY_UNDEFINED macro to IEEE80211_KEY_UNDEFINED Obtained from: netbsd Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_crypto.c#19 edit .. //depot/projects/wifi/sys/net80211/ieee80211_crypto.h#13 edit .. //depot/projects/wifi/sys/net80211/ieee80211_output.c#66 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_crypto.c#19 (text+ko) ==== @@ -90,7 +90,7 @@ } static int null_key_set(struct ieee80211com *ic, const struct ieee80211_key *k, - const u_int8_t mac[IEEE80211_ADDR_LEN]) + const u_int8_t mac[IEEE80211_ADDR_LEN]) { return 1; } @@ -521,7 +521,7 @@ */ wh = mtod(m, struct ieee80211_frame *); if (IEEE80211_IS_MULTICAST(wh->i_addr1) || - ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { + IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { if (ic->ic_def_txkey == IEEE80211_KEYIX_NONE) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_CRYPTO, "[%s] no default transmit key (%s) deftxkey %u\n", @@ -577,7 +577,7 @@ ivp = mtod(m, const u_int8_t *) + hdrlen; /* XXX contig */ keyid = ivp[IEEE80211_WEP_IVLEN]; if (IEEE80211_IS_MULTICAST(wh->i_addr1) || - ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) + IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) k = &ic->ic_nw_keys[keyid >> 6]; else k = &ni->ni_ucastkey; ==== //depot/projects/wifi/sys/net80211/ieee80211_crypto.h#13 (text+ko) ==== @@ -169,6 +169,9 @@ }; extern const struct ieee80211_cipher ieee80211_cipher_none; +#define IEEE80211_KEY_UNDEFINED(k) \ + ((k)->wk_cipher == &ieee80211_cipher_none) + void ieee80211_crypto_register(const struct ieee80211_cipher *); void ieee80211_crypto_unregister(const struct ieee80211_cipher *); int ieee80211_crypto_available(u_int cipher); ==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#66 (text+ko) ==== @@ -584,7 +584,6 @@ #undef TO_BE_RECLAIMED } -#define KEY_UNDEFINED(k) ((k).wk_cipher == &ieee80211_cipher_none) /* * Return the transmit key to use in sending a unicast frame. * If a unicast key is set we use that. When no unicast key is set @@ -593,9 +592,9 @@ static __inline struct ieee80211_key * ieee80211_crypto_getucastkey(struct ieee80211com *ic, struct ieee80211_node *ni) { - if (KEY_UNDEFINED(ni->ni_ucastkey)) { + if (IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { if (ic->ic_def_txkey == IEEE80211_KEYIX_NONE || - KEY_UNDEFINED(ic->ic_nw_keys[ic->ic_def_txkey])) + IEEE80211_KEY_UNDEFINED(&ic->ic_nw_keys[ic->ic_def_txkey])) return NULL; return &ic->ic_nw_keys[ic->ic_def_txkey]; } else { @@ -612,7 +611,7 @@ ieee80211_crypto_getmcastkey(struct ieee80211com *ic, struct ieee80211_node *ni) { if (ic->ic_def_txkey == IEEE80211_KEYIX_NONE || - KEY_UNDEFINED(ic->ic_nw_keys[ic->ic_def_txkey])) + IEEE80211_KEY_UNDEFINED(&ic->ic_nw_keys[ic->ic_def_txkey])) return NULL; return &ic->ic_nw_keys[ic->ic_def_txkey]; } @@ -827,7 +826,8 @@ if (eh.ether_type != htons(ETHERTYPE_PAE) || ((ic->ic_flags & IEEE80211_F_WPA) && (ic->ic_opmode == IEEE80211_M_STA ? - !KEY_UNDEFINED(*key) : !KEY_UNDEFINED(ni->ni_ucastkey)))) { + !IEEE80211_KEY_UNDEFINED(key) : + !IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)))) { wh->i_fc[1] |= IEEE80211_FC1_WEP; if (!ieee80211_crypto_enmic(ic, key, m, txfrag)) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_OUTPUT,