Date: Thu, 4 Jun 2009 18:31:12 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r193452 - projects/mesh11s/sys/net80211 Message-ID: <200906041831.n54IVCh6000618@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Thu Jun 4 18:31:12 2009 New Revision: 193452 URL: http://svn.freebsd.org/changeset/base/193452 Log: avoid IEEE80211_F_DATAPAD as it requires hardware understanding of 11s headers, for now we will have to use s/w crypto; this fixes data frame crashes with ath caused by ieee80211_decap copying data over the stack due to hdr size being rounded for datapad requirements Reviewed by: rpaulo Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 4 18:27:53 2009 (r193451) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 4 18:31:12 2009 (r193452) @@ -232,7 +232,7 @@ mesh_input(struct ieee80211_node *ni, st struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = vap->iv_ifp; struct ieee80211_frame *wh; - int hdrspace, need_tap; + int hdrlen, need_tap; uint8_t dir, type, subtype, qos; KASSERT(ni != NULL, ("null node")); @@ -282,13 +282,14 @@ mesh_input(struct ieee80211_node *ni, st "peer link not yet established (%s)", nodemeshstates[ni->ni_mlstate]); } - hdrspace = ieee80211_hdrspace(ic, wh) + /* NB: not ieee80211_hdrspace, datapad is not honored */ + hdrlen = ieee80211_hdrsize(wh) + sizeof(struct ieee80211_meshcntl); - if (m->m_len < hdrspace && - (m = m_pullup(m, hdrspace)) == NULL) { + if (m->m_len < hdrlen && + (m = m_pullup(m, hdrlen)) == NULL) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, - "data too short: expecting %u", hdrspace); + "data too short: expecting %u", hdrlen); vap->iv_stats.is_rx_tooshort++; goto out; /* XXX */ } @@ -311,7 +312,7 @@ mesh_input(struct ieee80211_node *ni, st * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrlen); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; @@ -324,7 +325,7 @@ mesh_input(struct ieee80211_node *ni, st /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrlen); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Thu Jun 4 18:27:53 2009 (r193451) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Thu Jun 4 18:31:12 2009 (r193452) @@ -1282,18 +1282,24 @@ ieee80211_encap(struct ieee80211vap *vap !IEEE80211_ADDR_EQ(eh.ether_shost, vap->iv_myaddr)); if (is4addr) hdrsize += IEEE80211_ADDR_LEN; - /* - * All Mesh data frames have a Mesh Control field. - */ - if (vap->iv_opmode == IEEE80211_M_MBSS) + if (vap->iv_opmode == IEEE80211_M_MBSS) { + /* + * Mesh data frames have a Mesh Control field. + * XXX also cannot honor DATAPAD as this is used by + * hardware and that hardware does not (yet) understand + * 11s headers so will be confused. + */ hdrsize += sizeof(struct ieee80211_meshcntl); - /* - * Honor driver DATAPAD requirement. - */ - if (ic->ic_flags & IEEE80211_F_DATAPAD) - hdrspace = roundup(hdrsize, sizeof(uint32_t)); - else hdrspace = hdrsize; + } else { + /* + * Honor driver DATAPAD requirement. + */ + if (ic->ic_flags & IEEE80211_F_DATAPAD) + hdrspace = roundup(hdrsize, sizeof(uint32_t)); + else + hdrspace = hdrsize; + } if (__predict_true((m->m_flags & M_FF) == 0)) { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906041831.n54IVCh6000618>