On Wednesday 26 January 2011 16:02:32 Sven Eckelmann wrote:
Didn't we say yesterday that we must either use ntohs or only read the first byte of the framecontrol? The last option which comes to my mind is to define IEEE80211_FCTL_FTYPE and IEEE80211_FTYPE_DATA for big and little endian independently.
I must have misunderstood something but you are right - I'm going to change it and publish a second patch.
if (fc & IEEE80211_STYPE_QOS_DATA)
hdr_len += 2;
Here are you testing only on bit. Are you sure that the other 3 bits aren't interesting? At least one combination isn't well defined by the 802.11 standard from 2007 and some others are null data types.
I'd claim we only care if it is QoS or not because all QoS packets have a longer header (QoS control field). The spec says: "bit 7 is set to 1 in the QoS data subtypes, which have QoS Control fields in their MAC headers"
Regards, Marek