aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-14 11:10:24 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:26 -0400
commitc29b9b9b0235d56e5602f61ed38702dd376aae20 (patch)
tree5db640ccdfb46b84a6de16d84e18b1011d6ab452
parent5d4ecd9370da6e32588f218a5495806635154352 (diff)
[MAC80211]: don't send invalid QoS frames
Kalle Valo noticed that QoS frames are sent with an invalid QoS control field; this is because we increase the header length but neither initialise the space nor actually have enough space in the header structure for the QoS control field. This patch fixes it by treating the QoS field specially and appending it explicitly, initialising it to zero. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/mac80211/tx.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9e952e37b7df..0820f127da2b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1487,7 +1487,20 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1487 nh_pos += encaps_len; 1487 nh_pos += encaps_len;
1488 h_pos += encaps_len; 1488 h_pos += encaps_len;
1489 } 1489 }
1490 memcpy(skb_push(skb, hdrlen), &hdr, hdrlen); 1490
1491 if (fc & IEEE80211_STYPE_QOS_DATA) {
1492 __le16 *qos_control;
1493
1494 qos_control = (__le16*) skb_push(skb, 2);
1495 memcpy(skb_push(skb, hdrlen - 2), &hdr, hdrlen - 2);
1496 /*
1497 * Maybe we could actually set some fields here, for now just
1498 * initialise to zero to indicate no special operation.
1499 */
1500 *qos_control = 0;
1501 } else
1502 memcpy(skb_push(skb, hdrlen), &hdr, hdrlen);
1503
1491 nh_pos += hdrlen; 1504 nh_pos += hdrlen;
1492 h_pos += hdrlen; 1505 h_pos += hdrlen;
1493 1506