From owner-p4-projects@FreeBSD.ORG Mon May 26 22:35:57 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 76B761065676; Mon, 26 May 2008 22:35:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39483106566B for ; Mon, 26 May 2008 22:35:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2474C8FC13 for ; Mon, 26 May 2008 22:35:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4QMZvLa003947 for ; Mon, 26 May 2008 22:35:57 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4QMZvjo003945 for perforce@freebsd.org; Mon, 26 May 2008 22:35:57 GMT (envelope-from sam@freebsd.org) Date: Mon, 26 May 2008 22:35:57 GMT Message-Id: <200805262235.m4QMZvjo003945@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 142324 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: Mon, 26 May 2008 22:35:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=142324 Change 142324 by sam@sam_ebb on 2008/05/26 22:35:11 use the newly added wk_macaddr to eliminate a hack Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#76 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#76 (text+ko) ==== @@ -139,7 +139,6 @@ static void ath_bmiss_vap(struct ieee80211vap *); static void ath_bmiss_proc(void *, int); static int ath_keyset(struct ath_softc *, const struct ieee80211_key *, - const u_int8_t [IEEE80211_ADDR_LEN], struct ieee80211_node *); static int ath_key_alloc(struct ieee80211vap *, const struct ieee80211_key *, @@ -1078,7 +1077,7 @@ return; k = &ni->ni_ucastkey; if (k->wk_keyix != IEEE80211_KEYIX_NONE) - ath_keyset(sc, k, ni->ni_macaddr, vap->iv_bss); + ath_keyset(sc, k, vap->iv_bss); } /* @@ -1108,11 +1107,8 @@ continue; for (i = 0; i < IEEE80211_WEP_NKID; i++) { const struct ieee80211_key *k = &vap->iv_nw_keys[i]; - if (k->wk_keyix == IEEE80211_KEYIX_NONE) - continue; - /* XXX group keys need bcast addr, should be in key */ - ath_keyset(sc, k, k->wk_flags & IEEE80211_KEY_GROUP ? - ifp->if_broadcastaddr : vap->iv_myaddr, vap->iv_bss); + if (k->wk_keyix != IEEE80211_KEYIX_NONE) + ath_keyset(sc, k, vap->iv_bss); } } /* @@ -2225,7 +2221,6 @@ */ static int ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k, - const u_int8_t mac0[IEEE80211_ADDR_LEN], struct ieee80211_node *bss) { #define N(a) (sizeof(a)/sizeof(a[0])) @@ -2269,7 +2264,7 @@ gmac[0] |= 0x80; mac = gmac; } else - mac = mac0; + mac = k->wk_macaddr; if (hk.kv_type == HAL_CIPHER_TKIP && (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { @@ -2528,7 +2523,7 @@ { struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; - return ath_keyset(sc, k, mac, vap->iv_bss); + return ath_keyset(sc, k, vap->iv_bss); } /* @@ -5850,8 +5845,9 @@ /* XXX locking? */ ni->ni_ucastkey.wk_keyix = keyix; ni->ni_ucastkey.wk_rxkeyix = rxkeyix; + IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr); /* NB: this will create a pass-thru key entry */ - ath_keyset(sc, &ni->ni_ucastkey, ni->ni_macaddr, vap->iv_bss); + ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss); } }