Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2008 21:17:27 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 138857 for review
Message-ID:  <200803282117.m2SLHRNG036872@repoman.freebsd.org>

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

Change 138857 by sam@sam_ebb on 2008/03/28 21:17:11

	close races between mlme ops and the rx path; this introduces
	at least one LOR that will need to be sorted out with the
	locking problem

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#47 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#47 (text+ko) ====

@@ -1271,6 +1271,7 @@
 	const uint8_t mac[IEEE80211_ADDR_LEN], int reason)
 {
 	struct ieee80211com *ic = vap->iv_ic;
+	struct ieee80211_node_table *nt = &ic->ic_sta;
 	struct ieee80211_node *ni;
 	struct mlmeop mlmeop;
 	int error;
@@ -1289,9 +1290,10 @@
 			mlmeop.vap = vap;
 			mlmeop.op = op;
 			mlmeop.reason = reason;
+			IEEE80211_NODE_LOCK(nt);
 			/* NB: the broadcast address means do 'em all */
 			if (!IEEE80211_ADDR_EQ(mac, ic->ic_ifp->if_broadcastaddr)) {
-				ni = ieee80211_find_node(&ic->ic_sta, mac);
+				ni = ieee80211_find_node_locked(nt, mac);
 				if (ni != NULL) {
 					domlme(&mlmeop, ni);
 					ieee80211_free_node(ni);
@@ -1301,6 +1303,7 @@
 				ieee80211_iterate_nodes(&ic->ic_sta,
 						domlme, &mlmeop);
 			}
+			IEEE80211_NODE_UNLOCK(nt);
 			break;
 		case IEEE80211_M_WDS:
 			/* XXX user app should send raw frame? */
@@ -1333,6 +1336,7 @@
 			error = EINVAL;
 			break;
 		}
+		IEEE80211_NODE_LOCK(nt);
 		ni = ieee80211_find_vap_node(&ic->ic_sta, vap, mac);
 		if (ni != NULL) {
 			mlmedebug(vap, mac, op, reason);
@@ -1343,12 +1347,14 @@
 			ieee80211_free_node(ni);
 		} else
 			error = ENOENT;
+		IEEE80211_NODE_UNLOCK(nt);
 		break;
 	case IEEE80211_MLME_AUTH:
 		if (vap->iv_opmode != IEEE80211_M_HOSTAP) {
 			error = EINVAL;
 			break;
 		}
+		IEEE80211_NODE_LOCK(nt);
 		ni = ieee80211_find_vap_node(&ic->ic_sta, vap, mac);
 		if (ni != NULL) {
 			mlmedebug(vap, mac, op, reason);
@@ -1373,6 +1379,7 @@
 			ieee80211_free_node(ni);
 		} else
 			error = ENOENT;
+		IEEE80211_NODE_UNLOCK(nt);
 		break;
 	default:
 		error = EINVAL;



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