From owner-svn-src-projects@FreeBSD.ORG Fri Jun 26 16:22:07 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 9CC94106566C; Fri, 26 Jun 2009 16:22:07 +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 7E9578FC14; Fri, 26 Jun 2009 16:22:07 +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 n5QGM72q091525; Fri, 26 Jun 2009 16:22:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5QGM7Ff091524; Fri, 26 Jun 2009 16:22:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906261622.n5QGM7Ff091524@svn.freebsd.org> From: Rui Paulo Date: Fri, 26 Jun 2009 16:22:07 +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: r195059 - 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: Fri, 26 Jun 2009 16:22:08 -0000 Author: rpaulo Date: Fri Jun 26 16:22:07 2009 New Revision: 195059 URL: http://svn.freebsd.org/changeset/base/195059 Log: * fix the action frame validation * send peer link close packets on ifconfig wlan0 down * revert the timers to the draft values 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 Fri Jun 26 16:03:32 2009 (r195058) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jun 26 16:22:07 2009 (r195059) @@ -84,12 +84,11 @@ static int mesh_verify_meshconf(struct i struct ieee80211_meshconf_ie *); /* timeout values in miliseconds */ -/* XXX: spec says 40 msec */ -static const int ieee80211_mesh_retrytimeout = 4000; +static const int ieee80211_mesh_retrytimeout = 40; #define RETRY_TIMEOUT msecs_to_ticks(ieee80211_mesh_retrytimeout) -static const int ieee80211_mesh_holdingtimeout = 4000; +static const int ieee80211_mesh_holdingtimeout = 40; #define HOLDING_TIMEOUT msecs_to_ticks(ieee80211_mesh_holdingtimeout) -static const int ieee80211_mesh_confirmtimeout = 4000; +static const int ieee80211_mesh_confirmtimeout = 40; #define CONFIRM_TIMEOUT msecs_to_ticks(ieee80211_mesh_confirmtimeout) static const int ieee80211_mesh_maxretries = 2; @@ -108,8 +107,20 @@ ieee80211_mesh_detach(struct ieee80211co } static void -mesh_vdetach_stoptimers(void *arg, struct ieee80211_node *ni) +mesh_vdetach_peers(void *arg, struct ieee80211_node *ni) { + union ieee80211_send_action_args vargs; + + if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED) { + vargs.fixedarg[0] = ni->ni_mlpid; + vargs.fixedarg[1] = ni->ni_mllid; + vargs.fixedarg[2] = + IEEE80211_REASON_PEER_LINK_CANCELED; + ieee80211_send_action(ni, + IEEE80211_ACTION_CAT_MESHPEERING, + IEEE80211_ACTION_MESHPEERING_CLOSE, + vargs); + } callout_stop(&ni->ni_mltimer); } @@ -117,7 +128,7 @@ mesh_vdetach_stoptimers(void *arg, struc static void mesh_vdetach(struct ieee80211vap *vap) { - ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_vdetach_stoptimers, + ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_vdetach_peers, NULL); ieee80211_hwmp_vdetach(vap); } @@ -161,6 +172,10 @@ mesh_newstate(struct ieee80211vap *vap, case IEEE80211_S_SCAN: ieee80211_cancel_scan(vap); break; + case IEEE80211_S_RUN: + ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, + mesh_vdetach_peers, NULL); + break; default: break; } @@ -902,11 +917,16 @@ mesh_recv_action(struct ieee80211_node * } frm += frm[1] + 2; } - + /* + * Verify the contents of the frame. Action frames with + * close subtype don't have a Mesh Configuration IE. + * If if fails validation, close the peer link. + */ if (mesh_verify_meshpeerver(vap, meshpeerver) || mesh_verify_meshid(vap, meshid) || - mesh_verify_meshconf(vap, meshconf) || - !meshpeer) { + !meshpeer || (meshpeer->peer_subtype != + IEEE80211_ACTION_MESHPEERING_CLOSE && + mesh_verify_meshconf(vap, meshconf))) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, wh, NULL, "%s", "action frame not for our mesh");