From owner-p4-projects@FreeBSD.ORG Fri Dec 3 01:57:25 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 712D916A4D0; Fri, 3 Dec 2004 01:57:23 +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 2C1F916A4CE for ; Fri, 3 Dec 2004 01:57:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C6B643D1D for ; Fri, 3 Dec 2004 01:57:23 +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 iB31vNpM026252 for ; Fri, 3 Dec 2004 01:57:23 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iB31vMAX026249 for perforce@freebsd.org; Fri, 3 Dec 2004 01:57:22 GMT (envelope-from sam@freebsd.org) Date: Fri, 3 Dec 2004 01:57:22 GMT Message-Id: <200412030157.iB31vMAX026249@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 66293 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: Fri, 03 Dec 2004 01:57:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=66293 Change 66293 by sam@sam_ebb on 2004/12/03 01:56:45 correct unicast cipher set setting and take into account available s/w ciphers when validated mcast and ucast cipher settings Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#22 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#22 (text+ko) ==== @@ -2148,8 +2148,8 @@ ic->ic_flags &= ~IEEE80211_F_NOBRIDGE; break; case IEEE80211_IOC_MCASTCIPHER: - /* XXX s/w implementations */ - if ((ic->ic_caps & cipher2cap(ireq->i_val)) == 0) + if ((ic->ic_caps & cipher2cap(ireq->i_val)) == 0 && + !ieee80211_crypto_available(ireq->i_val)) return EINVAL; rsn->rsn_mcastcipher = ireq->i_val; error = (ic->ic_flags & IEEE80211_F_WPA) ? ENETRESET : 0; @@ -2163,17 +2163,20 @@ break; case IEEE80211_IOC_UCASTCIPHERS: /* - * Convert cipher set to equivalent capabilities. + * Convert user-specified cipher set to the set + * we can support (via hardware or software). * NB: this logic intentionally ignores unknown and * unsupported ciphers so folks can specify 0xff or * similar and get all available ciphers. */ caps = 0; for (j = 1; j < 32; j++) /* NB: skip WEP */ - if (ireq->i_val & (1<ic_caps; /* restrict to supported ciphers */ + if ((ireq->i_val & (1<ic_caps & cipher2cap(j)) || + ieee80211_crypto_available(j))) + caps |= 1<rsn_ucastcipherset = caps;