From owner-p4-projects@FreeBSD.ORG Wed Mar 19 18:25:19 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 397821065673; Wed, 19 Mar 2008 18:25:19 +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 ED537106564A for ; Wed, 19 Mar 2008 18:25:18 +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 E2ECB8FC12 for ; Wed, 19 Mar 2008 18:25:18 +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 m2JIPIJD020118 for ; Wed, 19 Mar 2008 18:25:18 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2JIPIaw020116 for perforce@freebsd.org; Wed, 19 Mar 2008 18:25:18 GMT (envelope-from sam@freebsd.org) Date: Wed, 19 Mar 2008 18:25:18 GMT Message-Id: <200803191825.m2JIPIaw020116@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 138117 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: Wed, 19 Mar 2008 18:25:19 -0000 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);