Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2008 18:56:53 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139364 for review
Message-ID:  <200804041856.m34Iurbj095345@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <net/if.h>
 #include <net/if_clone.h>
 #include <net/if_media.h>
+#include <net/if_types.h>
 #include <net/ethernet.h>
 #include <net/route.h>
 
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804041856.m34Iurbj095345>