svn commit: r195139 - projects/mesh11s/sys/net80211

Sam Leffler sam at FreeBSD.org
Sun Jun 28 16:50:38 UTC 2009


Author: sam
Date: Sun Jun 28 16:50:38 2009
New Revision: 195139
URL: http://svn.freebsd.org/changeset/base/195139

Log:
  Tighten up beacon rx path:
  o require mesh ie's before processing frame
  o require capabilities w/o IBSS and ESS before processing frame
  o add parens
  o fixup comments to match
  o mark need to backoff on repeated peering failures

Modified:
  projects/mesh11s/sys/net80211/ieee80211_mesh.c

Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.c	Sun Jun 28 16:34:33 2009	(r195138)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.c	Sun Jun 28 16:50:38 2009	(r195139)
@@ -689,25 +689,33 @@ mesh_recv_mgmt(struct ieee80211_node *ni
 			return;
 		}
 
-		/* The rest of this code assumes we setup and running */
+		/* The rest of this code assumes we are running */
 		if (vap->iv_state != IEEE80211_S_RUN)
 			return;
 		/*
-		 * Ignore non-mesh STAs and STAs for other mesh networks.
+		 * Ignore non-mesh STAs.
 		 */
-		if (scan.meshid && scan.meshconf &&
-		    memcmp(scan.meshid+2, ms->ms_id, ms->ms_idlen) != 0) {
-			IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, ni,
-			    "beacon not for our mesh (%s)", scan.meshid+2);
+		if ((scan.capinfo &
+		     (IEEE80211_CAPINFO_ESS|IEEE80211_CAPINFO_IBSS)) ||
+		    scan.meshid == NULL || scan.meshconf == NULL) {
+			IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
+			    wh, "beacon", "%s", "not a mesh sta");
 			return;
 		}
-		
 		/*
-		 * More validation: make sure we are talking to a Mesh node.
+		 * Ignore STAs for other mesh networks.
 		 */
-		if ((scan.capinfo &
-		    (IEEE80211_CAPINFO_ESS|IEEE80211_CAPINFO_IBSS)) == 0 &&
-		    !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
+		if (memcmp(scan.meshid+2, ms->ms_id, ms->ms_idlen) != 0) {
+			IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
+			    wh, "beacon", "not for our mesh (%s)",
+			    scan.meshid+2);
+			return;
+		}
+
+		/*
+		 * Do neighbor discovery.
+		 */
+		if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
 			/*
 			 * Create a new entry in the neighbor table.
 			 */
@@ -718,10 +726,11 @@ mesh_recv_mgmt(struct ieee80211_node *ni
 			ni->ni_flags |= IEEE80211_NODE_QOS;
 		}
 		/*
-		 * Try to peer with this node if possible.
+		 * Automatically peer with discovered nodes if possible.
+		 * XXX backoff on repeated failure
 		 */
 		if (ni != vap->iv_bss &&
-		    ms->ms_flags & IEEE80211_MESHFLAGS_AP &&
+		    (ms->ms_flags & IEEE80211_MESHFLAGS_AP) &&
 		    ni->ni_mlstate == IEEE80211_NODE_MESH_IDLE) {
 			union ieee80211_send_action_args sargs;
 


More information about the svn-src-projects mailing list