aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/451-ibss_race_fix.patch
blob: 662f454eff006d33c3f7b3e8da363a6a04003b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/net80211/ieee80211_input.c
+++ b/net80211/ieee80211_input.c
@@ -3573,6 +3573,9 @@ ieee80211_recv_mgmt(struct ieee80211vap 
 				found = 1;
 				ni = ni_or_null = vap->iv_wdsnode;
 			} else if (vap->iv_opmode == IEEE80211_M_IBSS) {
+				if (vap->iv_state != IEEE80211_S_RUN)
+					break;
+
 				ni_or_null = ieee80211_find_node(&ic->ic_sta, wh->i_addr2);
 				if (ni_or_null)
 					ni = ni_or_null;
--- a/net80211/ieee80211_node.c
+++ b/net80211/ieee80211_node.c
@@ -317,16 +317,10 @@ ieee80211_create_ibss(struct ieee80211va
 	/* Check to see if we already have a node for this mac
 	 * NB: we gain a node reference here
 	 */
-	ni = ieee80211_find_txnode(vap, vap->iv_myaddr);
+	ni = ieee80211_alloc_node(vap, vap->iv_myaddr);
 	if (ni == NULL) {
-		ni = ieee80211_alloc_node_table(vap, vap->iv_myaddr);
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
-				  "%s: ni:%p allocated for " MAC_FMT "\n",
-				  __func__, ni, MAC_ADDR(vap->iv_myaddr));
-		if (ni == NULL) {
-			/* XXX recovery? */
-			return;
-		}
+		/* XXX recovery? */
+		return;
 	}
 
 	IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_myaddr);