Fragment and 11s inconsistency
Monthadar Al Jaberi
monthadar at gmail.com
Tue Feb 14 22:14:58 UTC 2012
Hi,
I cant verify this yet, but isn't there something wrong in current FreeBSD?
lets say an 11s data frame need to be fragmented in ieee80211_encap:
if (addqos)
hdrsize = sizeof(struct ieee80211_qosframe);
else
hdrsize = sizeof(struct ieee80211_frame);
...
if (vap->iv_opmode == IEEE80211_M_MBSS) {
...
if (!IEEE80211_IS_MULTICAST(eh.ether_dhost))
hdrsize += IEEE80211_ADDR_LEN; /* unicast are 4-addr */
meshhdrsize = sizeof(struct ieee80211_meshcntl);
}
...
if (__predict_true((m->m_flags & M_FF) == 0)) {
/*
* Normal frame.
*/
m = ieee80211_mbuf_adjust(vap, hdrspace + meshhdrsize, key, m);
}
M_PREPEND(m, hdrspace + meshhdrsize, M_DONTWAIT);
if (txfrag && !ieee80211_fragment(vap, m, hdrsize,
key != NULL ? key->wk_cipher->ic_header : 0, vap->iv_fragthreshold))
goto bad;
This means we send meshcontrol only in first segment, because we never
add meshhdrsize to hdrsize...
but in mesh_input
switch (type) {
case IEEE80211_FC0_TYPE_DATA:
...
meshdrlen = sizeof(struct ieee80211_meshcntl) +
(mc->mc_flags & 3) * IEEE80211_ADDR_LEN;
hdrspace += meshdrlen;
...
/*
* Potentially forward packet. See table s36 (p140)
* for the rules. XXX tap fwd'd packets not for us?
*/
if (dir == IEEE80211_FC1_DIR_FROMDS ||
!mesh_isucastforme(vap, wh, mc)) {
mesh_forward(vap, m, mc);
...
if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
m = ieee80211_defrag(ni, m, hdrspace);
if (m == NULL) {
This seems wrong to me, how can we potentially forward before defragin
the frame? this will fail cause sub-frag have no mesh control as code
shows above.
shouldnt the defrag code be moved above?
I am attaching a patch that both moves the defrag, validates that mesh
control is present and makes 11s data frames QoS and set Mesh control
bit present to 1 as the amendment specifies.
br,
--
Monthadar Al Jaberi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-mesh-data-frames-to-be-quality-of-service-QoS.patch
Type: text/x-patch
Size: 6723 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-wireless/attachments/20120214/048d0ea0/0001-Make-mesh-data-frames-to-be-quality-of-service-QoS.bin
More information about the freebsd-wireless
mailing list