PERFORCE change 141937 for review

Sam Leffler sam at FreeBSD.org
Tue May 20 22:58:13 UTC 2008


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

Change 141937 by sam at sam_ebb on 2008/05/20 22:58:08

	Handle broadcast probe request frames specially when locating a
	node on packet receive.  If the sender is associated then we were
	sending the packet only to the vap it was associated to but we
	need to spam all vap's so probe responses are generated; otherwise
	the sta's scan cache won't show all our vap's.
	Noticed by:	Jared Go
	MFP4 after:	1 week

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_node.c#33 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_node.c#33 (text+ko) ====

@@ -1311,6 +1311,24 @@
 	((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_PS_POLL)
 #define	IS_BAR(wh) \
 	((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_BAR)
+#define	IS_PROBEREQ(wh) \
+	((wh->i_fc[0] & (IEEE80211_FC0_TYPE_MASK|IEEE80211_FC0_SUBTYPE_MASK)) \
+	    == (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ))
+#define	IS_BCAST_PROBEREQ(wh) \
+	(IS_PROBEREQ(wh) && IEEE80211_IS_MULTICAST( \
+	    ((const struct ieee80211_frame *)(wh))->i_addr3))
+
+static __inline struct ieee80211_node *
+_find_rxnode(struct ieee80211_node_table *nt,
+    const struct ieee80211_frame_min *wh)
+{
+	/* XXX 4-address frames? */
+	if (IS_CTL(wh) && !IS_PSPOLL(wh) && !IS_BAR(wh) /*&& !IS_RTS(ah)*/)
+		return ieee80211_find_node_locked(nt, wh->i_addr1);
+	if (IS_BCAST_PROBEREQ(wh))
+		return NULL;		/* spam bcast probe req to all vap's */
+	return ieee80211_find_node_locked(nt, wh->i_addr2);
+}
 
 /*
  * Locate the node for sender, track state, and then pass the
@@ -1329,13 +1347,9 @@
 	struct ieee80211_node_table *nt;
 	struct ieee80211_node *ni;
 
-	/* XXX 4-address frames? */
 	nt = &ic->ic_sta;
 	IEEE80211_NODE_LOCK(nt);
-	if (IS_CTL(wh) && !IS_PSPOLL(wh) && !IS_BAR(wh) /*&& !IS_RTS(ah)*/)
-		ni = ieee80211_find_node_locked(nt, wh->i_addr1);
-	else
-		ni = ieee80211_find_node_locked(nt, wh->i_addr2);
+	ni = _find_rxnode(nt, wh);
 	IEEE80211_NODE_UNLOCK(nt);
 
 	return ni;
@@ -1369,10 +1383,7 @@
 	else
 		ni = NULL;
 	if (ni == NULL) {
-		if (IS_CTL(wh) && !IS_PSPOLL(wh) && !IS_BAR(wh) /*&& !IS_RTS(ah)*/)
-			ni = ieee80211_find_node_locked(nt, wh->i_addr1);
-		else
-			ni = ieee80211_find_node_locked(nt, wh->i_addr2);
+		ni = _find_rxnode(nt, wh);
 		if (ni != NULL && nt->nt_keyixmap != NULL) {
 			/*
 			 * If the station has a unicast key cache slot
@@ -1390,12 +1401,18 @@
 				nt->nt_keyixmap[keyix] = ieee80211_ref_node(ni);
 			}
 		}
-	} else
-		ieee80211_ref_node(ni);
+	} else {
+		if (IS_BCAST_PROBEREQ(wh))
+			ni = NULL;	/* spam bcast probe req to all vap's */
+		else
+			ieee80211_ref_node(ni);
+	}
 	IEEE80211_NODE_UNLOCK(nt);
 
 	return ni;
 }
+#undef IS_BCAST_PROBEREQ
+#undef IS_PROBEREQ
 #undef IS_BAR
 #undef IS_PSPOLL
 #undef IS_CTL


More information about the p4-projects mailing list