From owner-p4-projects@FreeBSD.ORG Wed Oct 27 19:48:19 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 72B0416A4D0; Wed, 27 Oct 2004 19:48:19 +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 3770F16A4CE for ; Wed, 27 Oct 2004 19:48:19 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BC0643D45 for ; Wed, 27 Oct 2004 19:48:19 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9RJmJFC011324 for ; Wed, 27 Oct 2004 19:48:19 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9RJmIMp011321 for perforce@freebsd.org; Wed, 27 Oct 2004 19:48:18 GMT (envelope-from sam@freebsd.org) Date: Wed, 27 Oct 2004 19:48:18 GMT Message-Id: <200410271948.i9RJmIMp011321@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 63843 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: Wed, 27 Oct 2004 19:48:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=63843 Change 63843 by sam@sam_ebb on 2004/10/27 19:47:46 Change IEEE80211_IOC_WPAIE to copy only the mac address in and only as much data as request out. Makes it a bit more convenient to use. Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#5 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#5 (text+ko) ==== @@ -890,9 +890,9 @@ struct ieee80211req_wpaie wpaie; int error; - if (ireq->i_len != sizeof(wpaie)) + if (ireq->i_len < IEEE80211_ADDR_LEN) return EINVAL; - error = copyin(ireq->i_data, &wpaie, sizeof(wpaie)); + error = copyin(ireq->i_data, wpaie.wpa_macaddr, IEEE80211_ADDR_LEN); if (error != 0) return error; ni = ieee80211_find_node(ic, wpaie.wpa_macaddr); @@ -906,7 +906,9 @@ memcpy(wpaie.wpa_ie, ni->ni_wpa_ie, ielen); } ieee80211_free_node(ic, ni); - return copyout(&wpaie, ireq->i_data, sizeof(wpaie)); + if (ireq->i_len > sizeof(wpaie)) + ireq->i_len = sizeof(wpaie); + return copyout(&wpaie, ireq->i_data, ireq->i_len); } static int