From owner-svn-src-projects@FreeBSD.ORG Tue Jun 9 20:16:23 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 644D7106567B; Tue, 9 Jun 2009 20:16:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5313E8FC19; Tue, 9 Jun 2009 20:16:23 +0000 (UTC) (envelope-from rpaulo@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 n59KGMpt082416; Tue, 9 Jun 2009 20:16:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59KGMOd082415; Tue, 9 Jun 2009 20:16:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906092016.n59KGMOd082415@svn.freebsd.org> From: Rui Paulo Date: Tue, 9 Jun 2009 20:16:22 +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: r193852 - 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: Tue, 09 Jun 2009 20:16:23 -0000 Author: rpaulo Date: Tue Jun 9 20:16:22 2009 New Revision: 193852 URL: http://svn.freebsd.org/changeset/base/193852 Log: Move code previously added to vdetach to vattach. Add debugging to verify_meshconf() Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jun 9 19:51:34 2009 (r193851) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jun 9 20:16:22 2009 (r193852) @@ -117,8 +117,6 @@ static void mesh_vdetach(struct ieee80211vap *vap) { ieee80211_hwmp_vdetach(vap); - vap->iv_meshseq = 0; - vap->iv_meshflags = (IEEE80211_MFLAGS_AP | IEEE80211_MFLAGS_FWRD); } static void @@ -128,6 +126,8 @@ mesh_vattach(struct ieee80211vap *vap) vap->iv_input = mesh_input; vap->iv_opdetach = mesh_vdetach; vap->iv_recv_mgmt = mesh_recv_mgmt; + vap->iv_meshseq = 0; + vap->iv_meshflags = (IEEE80211_MFLAGS_AP | IEEE80211_MFLAGS_FWRD); ieee80211_hwmp_vattach(vap); } @@ -1043,21 +1043,53 @@ mesh_verify_meshconf(struct ieee80211vap if (meshconf == NULL) return 1; - if (meshconf->conf_ver != IEEE80211_MESHCONF_VERSION) + if (meshconf->conf_ver != IEEE80211_MESHCONF_VERSION) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "wrong mesh conf version: %d\n", meshconf->conf_ver); return 1; - if (memcmp(meshconf->conf_pselid, hwmp, 4) != 0) + } + if (memcmp(meshconf->conf_pselid, hwmp, 4) != 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "unknown path selection algorithm: 0x%x%x%x%x\n", + meshconf->conf_pselid[0], meshconf->conf_pselid[1], + meshconf->conf_pselid[2], meshconf->conf_pselid[3]); return 1; - if (memcmp(meshconf->conf_pmetid, airtime, 4) != 0) + } + if (memcmp(meshconf->conf_pmetid, airtime, 4) != 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "unknown path metric algorithm: 0x%x%x%x%x\n", + meshconf->conf_pmetid[0], meshconf->conf_pmetid[1], + meshconf->conf_pmetid[2], meshconf->conf_pmetid[3]); return 1; - if (memcmp(meshconf->conf_ccid, null, 4) != 0) + } + if (memcmp(meshconf->conf_ccid, null, 4) != 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "unknown congestion sig algorithm: 0x%x%x%x%x\n", + meshconf->conf_ccid[0], meshconf->conf_ccid[1], + meshconf->conf_ccid[2], meshconf->conf_ccid[3]); return 1; - if (memcmp(meshconf->conf_syncid, null, 4) != 0) + } + if (memcmp(meshconf->conf_syncid, null, 4) != 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "unknown sync algorithm: 0x%x%x%x%x\n", + meshconf->conf_syncid[0], meshconf->conf_syncid[1], + meshconf->conf_syncid[2], meshconf->conf_syncid[3]); return 1; - if (memcmp(meshconf->conf_authid, null, 4) != 0) + } + if (memcmp(meshconf->conf_authid, null, 4) != 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "unknown auth auth algorithm: 0x%x%x%x%x\n", + meshconf->conf_pselid[0], meshconf->conf_pselid[1], + meshconf->conf_pselid[2], meshconf->conf_pselid[3]); return 1; + } /* Not accepting peers */ - if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) + if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, + "not accepting peers: 0x%x\n", meshconf->conf_cap); return 1; + } + return 0; }