Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 2008 18:25:18 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 138117 for review
Message-ID:  <200803191825.m2JIPIaw020116@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=138117

Change 138117 by sam@sam_ebb on 2008/03/19 18:24:48

	plug another path into net80211 from above to handle vap
	teardown; if_output is called w/o checking OACTIVE so we
	must do it explicitly and avoid touching vap state

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_output.c#41 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_output.c#41 (text+ko) ====

@@ -290,12 +290,24 @@
 	struct sockaddr *dst, struct rtentry *rt0)
 {
 #define senderr(e) do { error = (e); goto bad;} while (0)
-	struct ieee80211vap *vap = ifp->if_softc;
-	struct ieee80211com *ic = vap->iv_ic;
 	struct ieee80211_node *ni = NULL;
+	struct ieee80211vap *vap;
 	struct ieee80211_frame *wh;
 	int error;
 
+	if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
+		/*
+		 * Short-circuit requests if the vap is marked OACTIVE
+		 * as this is used when tearing down state to indicate
+		 * the vap may be gone.  This can also happen because a
+		 * packet came down through ieee80211_start before the
+		 * vap entered RUN state in which case it's also ok to
+		 * just drop the frame.  This should not be necessary
+		 * but callers of if_output don't check OACTIVE.
+		 */
+		senderr(ENETDOWN);
+	}
+	vap = ifp->if_softc;
 	/*
 	 * Hand to the 802.3 code if not tagged as
 	 * a raw 802.11 frame.
@@ -373,8 +385,9 @@
 	 * this is a hack).
 	 * NB: we assume sa_data is suitably aligned to cast.
 	 */
-	return ic->ic_raw_xmit(ni, m, (const struct ieee80211_bpf_params *)
-		(dst->sa_len ? dst->sa_data : NULL));
+	return vap->iv_ic->ic_raw_xmit(ni, m,
+	    (const struct ieee80211_bpf_params *)(dst->sa_len ?
+		dst->sa_data : NULL));
 bad:
 	if (m != NULL)
 		m_freem(m);



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