Date: Fri, 26 Jun 2009 16:22:07 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195059 - projects/mesh11s/sys/net80211 Message-ID: <200906261622.n5QGM7Ff091524@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906261622.n5QGM7Ff091524>