From owner-p4-projects@FreeBSD.ORG Fri Apr 4 18:56:53 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B3D971065674; Fri, 4 Apr 2008 18:56:53 +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 75903106566C for ; Fri, 4 Apr 2008 18:56:53 +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 4EE1C8FC17 for ; Fri, 4 Apr 2008 18:56:53 +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 m34Iurx9095347 for ; Fri, 4 Apr 2008 18:56:53 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m34Iurbj095345 for perforce@freebsd.org; Fri, 4 Apr 2008 18:56:53 GMT (envelope-from sam@freebsd.org) Date: Fri, 4 Apr 2008 18:56:53 GMT Message-Id: <200804041856.m34Iurbj095345@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 139364 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: Fri, 04 Apr 2008 18:56:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=139364 Change 139364 by sam@sam_ebb on 2008/04/04 18:56:14 require parent ifnet type be IFT_IEEE80211 to avoid crashing if handed a device that doesn't have the ieee8011com structure install as if_softc (to be fixed correctly shortly but worth doing regardless) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#24 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.c#24 (text+ko) ==== @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,10 @@ ifp = ifunit(cp.icp_parent); if (ifp == NULL) return ENXIO; + if (ifp->if_type != IFT_IEEE80211) { + if_printf(ifp, "%s: reject, not an 802.11 device\n", __func__); + return EINVAL; + } ic = ifp->if_softc; /* XXX forces ic at front of softc */ vap = ic->ic_vap_create(ic, ifc->ifc_name, unit, cp.icp_opmode, cp.icp_flags, cp.icp_bssid,