PERFORCE change 138756 for review

Sam Leffler sam at FreeBSD.org
Thu Mar 27 15:38:52 PDT 2008


http://perforce.freebsd.org/chv.cgi?CH=138756

Change 138756 by sam at 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);
 }
 


More information about the p4-projects mailing list