summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_mesh.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-02-13 07:47:36 +0000
committeradrian <adrian@FreeBSD.org>2012-02-13 07:47:36 +0000
commitfc22b32e3bb40c112840df1400401cf69591775e (patch)
treed64514ddc7e4ae174f0698087c565656372efddc /sys/net80211/ieee80211_mesh.c
parentec1b2e79af52abdada53ccd66958e12b288c6193 (diff)
downloadFreeBSD-src-fc22b32e3bb40c112840df1400401cf69591775e.zip
FreeBSD-src-fc22b32e3bb40c112840df1400401cf69591775e.tar.gz
Correct the 802.11s mesh configuration structure and related tidbits.
* Change the mesh IE size to be IEEE80211_MESH_CONF_SZ rather than the size of the structure; * conf_cap is now a uint8_t rather than a uint16_t (uint16_t in D3.0, uint8_t in the amendment spec); * Update mesh config capability bits - earlier bits were from draft X, current is amendment spec; * Update the following to be an enum rather than #define and added a VENDOR entry too from the amendment spec; IEEE80211_MESHCONF_PATH_* IEEE80211_MESHCONF_METRIC_* IEEE80211_MESHCONF_CC_* IEEE80211_MESHCONF_SYNC_* IEEE80211_MESHCONF_AUTH_* * Kept IEEE80211_MESHCONF_FORM_* and IEEE80211_MESHCONF_CAP_* as defines because they are defined in a way that we need to mask in/out information; * In IEEE80211_MESHCONF_CAP_* IEEE80211_MESHCONF_CAP_TBTTA is removed and 0x80 is made reserved as defined in the amendment spec. Submitted by: monthadar@gmail.com Reviewed by: rpaulo
Diffstat (limited to 'sys/net80211/ieee80211_mesh.c')
-rw-r--r--sys/net80211/ieee80211_mesh.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
index 2ef3649..1f8518c 100644
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -2289,7 +2289,6 @@ mesh_verify_meshconf(struct ieee80211vap *vap, const uint8_t *ie)
const struct ieee80211_meshconf_ie *meshconf =
(const struct ieee80211_meshconf_ie *) ie;
const struct ieee80211_mesh_state *ms = vap->iv_mesh;
- uint16_t cap;
if (meshconf == NULL)
return 1;
@@ -2323,10 +2322,8 @@ mesh_verify_meshconf(struct ieee80211vap *vap, const uint8_t *ie)
meshconf->conf_pselid);
return 1;
}
- /* NB: conf_cap is only read correctly here */
- cap = LE_READ_2(&meshconf->conf_cap);
/* Not accepting peers */
- if (!(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;
@@ -2395,7 +2392,7 @@ ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap)
KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap"));
*frm++ = IEEE80211_ELEMID_MESHCONF;
- *frm++ = sizeof(struct ieee80211_meshconf_ie) - 2;
+ *frm++ = IEEE80211_MESH_CONF_SZ;
*frm++ = ms->ms_ppath->mpp_ie; /* path selection */
*frm++ = ms->ms_pmetric->mpm_ie; /* link metric */
*frm++ = IEEE80211_MESHCONF_CC_DISABLED;
@@ -2411,7 +2408,7 @@ ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap)
caps |= IEEE80211_MESHCONF_CAP_AP;
if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
caps |= IEEE80211_MESHCONF_CAP_FWRD;
- ADDSHORT(frm, caps);
+ *frm++ = caps;
return frm;
}
OpenPOWER on IntegriCloud