svn commit: r202295 - head/sys/net80211

Rui Paulo rpaulo at FreeBSD.org
Thu Jan 14 19:23:41 UTC 2010


Author: rpaulo
Date: Thu Jan 14 19:23:41 2010
New Revision: 202295
URL: http://svn.freebsd.org/changeset/base/202295

Log:
  Fix bugs introduced in previous commit: off-by-one in add_meshconf() and
  big-endian bug on verify_meshconf()

Modified:
  head/sys/net80211/ieee80211_mesh.c

Modified: head/sys/net80211/ieee80211_mesh.c
==============================================================================
--- head/sys/net80211/ieee80211_mesh.c	Thu Jan 14 19:14:24 2010	(r202294)
+++ head/sys/net80211/ieee80211_mesh.c	Thu Jan 14 19:23:41 2010	(r202295)
@@ -2283,6 +2283,7 @@ mesh_verify_meshconf(struct ieee80211vap
 	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;
@@ -2316,8 +2317,10 @@ mesh_verify_meshconf(struct ieee80211vap
 		    meshconf->conf_pselid);
 		return 1;
 	}
+	/* NB: conf_cap is only read correctly here */
+	cap = LE_READ_2(&meshconf->conf_cap);
 	/* Not accepting peers */
-	if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) {
+	if (!(cap & IEEE80211_MESHCONF_CAP_AP)) {
 		IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH,
 		    "not accepting peers: 0x%x\n", meshconf->conf_cap);
 		return 1;
@@ -2403,7 +2406,6 @@ ieee80211_add_meshconf(uint8_t *frm, str
 	if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
 		caps |= IEEE80211_MESHCONF_CAP_FWRD;
 	ADDSHORT(frm, caps);
-	frm += 1;
 	return frm;
 }
 


More information about the svn-src-all mailing list