From owner-p4-projects@FreeBSD.ORG Thu Mar 27 22:38:52 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE7DD1065672; Thu, 27 Mar 2008 22:38:51 +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 9DA1F1065671 for ; Thu, 27 Mar 2008 22:38:51 +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 8D3888FC13 for ; Thu, 27 Mar 2008 22:38:51 +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 m2RMcpkj080434 for ; Thu, 27 Mar 2008 22:38:51 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2RMcpr9080432 for perforce@freebsd.org; Thu, 27 Mar 2008 22:38:51 GMT (envelope-from sam@freebsd.org) Date: Thu, 27 Mar 2008 22:38:51 GMT Message-Id: <200803272238.m2RMcpr9080432@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 138756 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: Thu, 27 Mar 2008 22:38:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=138756 Change 138756 by sam@sam_ebb on 2008/03/27 22:38:21 handle promisc/mcast driver callbacks in ieee80211_syncifflag_locked as this is typically where they should occur; note they are done under the com lock which may be a problem for some drivers so we may need to push them up to the caller to allow dropping the com lock this fixes propagation of IFF_PROMISC bit Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211.c#30 edit .. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#22 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211.c#30 (text+ko) ==== @@ -532,8 +532,9 @@ void ieee80211_syncifflag_locked(struct ieee80211com *ic, int flag) { + struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; - int bit; + int bit, oflags; IEEE80211_LOCK_ASSERT(ic); @@ -543,10 +544,20 @@ bit = 1; break; } + oflags = ifp->if_flags; if (bit) - ic->ic_ifp->if_flags |= flag; + ifp->if_flags |= flag; else - ic->ic_ifp->if_flags &= ~flag; + ifp->if_flags &= ~flag; + if ((ifp->if_flags ^ oflags) & flag) { + /* XXX should we return 1/0 and let caller do this? */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (flag == IFF_PROMISC) + ic->ic_update_promisc(ifp); + else if (flag == IFF_ALLMULTI) + ic->ic_update_mcast(ifp); + } + } } /* ==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#22 (text+ko) ==== @@ -1473,11 +1473,8 @@ static void ap_reset_promisc(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - IEEE80211_LOCK(ic); ieee80211_syncifflag_locked(ic, IFF_PROMISC); - ic->ic_update_promisc(ifp); IEEE80211_UNLOCK(ic); }