From owner-svn-src-projects@FreeBSD.ORG Sun Jun 28 16:50:38 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8642E1065676; Sun, 28 Jun 2009 16:50:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5435B8FC22; Sun, 28 Jun 2009 16:50:38 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5SGocUi016634; Sun, 28 Jun 2009 16:50:38 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5SGocfQ016632; Sun, 28 Jun 2009 16:50:38 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906281650.n5SGocfQ016632@svn.freebsd.org> From: Sam Leffler Date: Sun, 28 Jun 2009 16:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195139 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2009 16:50:38 -0000 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;