svn commit: r194434 - projects/mesh11s/sys/net80211
Rui Paulo
rpaulo at FreeBSD.org
Thu Jun 18 11:15:50 UTC 2009
Author: rpaulo
Date: Thu Jun 18 11:15:49 2009
New Revision: 194434
URL: http://svn.freebsd.org/changeset/base/194434
Log:
Flush the HWMP routing table upon SCAN state.
Sponsored by: The FreeBSD Foundation
Modified:
projects/mesh11s/sys/net80211/ieee80211_hwmp.c
projects/mesh11s/sys/net80211/ieee80211_hwmp.h
projects/mesh11s/sys/net80211/ieee80211_mesh.c
Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jun 18 11:12:11 2009 (r194433)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jun 18 11:15:49 2009 (r194434)
@@ -173,6 +173,35 @@ ieee80211_hwmp_vdetach(struct ieee80211v
}
mtx_destroy(&hs->hs_lock);
free(vap->iv_hwmp, M_80211_HWMP);
+}
+
+int
+ieee80211_hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg)
+{
+ enum ieee80211_state nstate = vap->iv_state;
+ struct ieee80211_hwmp_state *hs = vap->iv_hwmp;
+ struct ieee80211_hwmp_fi *fi, *next;
+
+ switch (nstate) {
+ case IEEE80211_S_SCAN:
+ switch (ostate) {
+ case IEEE80211_S_INIT:
+ /*
+ * Flush the HWMP routing table
+ */
+ if (hs == NULL)
+ return 0;
+ TAILQ_FOREACH_SAFE(fi, &hs->hs_head, fi_next, next) {
+ TAILQ_REMOVE(&hs->hs_head, fi, fi_next);
+ free(fi, M_80211_HWMP);
+ }
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
}
void
@@ -195,6 +224,10 @@ ieee80211_hwmp_recv_action(struct ieee80
KASSERT(ia->ia_category == IEEE80211_ACTION_CAT_MESHPATH,
("wrong category"));
+ if (ni == vap->iv_bss ||
+ ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED)
+ return;
+
while (efrm - frm > 1) {
/*IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return);*/
switch (*frm) {
Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.h
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.h Thu Jun 18 11:12:11 2009 (r194433)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.h Thu Jun 18 11:15:49 2009 (r194434)
@@ -66,6 +66,7 @@ struct ieee80211_hwmp_state {
void ieee80211_hwmp_vattach(struct ieee80211vap *);
void ieee80211_hwmp_vdetach(struct ieee80211vap *);
+int ieee80211_hwmp_newstate(struct ieee80211vap *, enum ieee80211_state, int);
void ieee80211_hwmp_recv_action(struct ieee80211vap *,
struct ieee80211_node *, struct mbuf *);
struct ieee80211_node *
Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 18 11:12:11 2009 (r194433)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 18 11:15:49 2009 (r194434)
@@ -170,12 +170,12 @@ mesh_newstate(struct ieee80211vap *vap,
if (vap->iv_des_chan != IEEE80211_CHAN_ANYC &&
!IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan) &&
vap->iv_meshidlen != 0) {
- /*
- * Already have a channel and a mesh ID; bypass the
- * scan and startup immediately.
- */
- ieee80211_create_mbss(vap, vap->iv_des_chan);
- break;
+ /*
+ * Already have a channel and a mesh ID; bypass
+ * the * scan and startup immediately.
+ */
+ ieee80211_create_mbss(vap, vap->iv_des_chan);
+ break;
}
/*
* Initiate a scan. We can come here as a result
@@ -208,6 +208,9 @@ mesh_newstate(struct ieee80211vap *vap,
break;
}
+ /* NB: ostate not nstate */
+ ieee80211_hwmp_newstate(vap, ostate, arg);
+
return 0;
}
More information about the svn-src-projects
mailing list