All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: don't send invalid QoS frames
@ 2007-08-30 14:22 Johannes Berg
  2007-08-31  8:43 ` Kalle Valo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johannes Berg @ 2007-08-30 14:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Michael Wu, Kalle Valo

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>

---
Kalle, please check if this fixes the weird frames you saw. I think it
will but would like to be sure. If it does, please say so and then we
should merge this patch to 2.6.24 and wireless-dev and I may make one
for -stable as well.

I think this is nicer than my previous patch because it explicitly
appends the QoS field and gives us a place to modify it should we ever
want.

 net/mac80211/tx.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- wireless-dev.orig/net/mac80211/tx.c	2007-08-30 14:35:21.152051253 +0200
+++ wireless-dev/net/mac80211/tx.c	2007-08-30 16:16:17.595374680 +0200
@@ -1493,7 +1493,20 @@ int ieee80211_subif_start_xmit(struct sk
 		nh_pos += encaps_len;
 		h_pos += encaps_len;
 	}
-	memcpy(skb_push(skb, hdrlen), &hdr, hdrlen);
+
+	if (fc & IEEE80211_STYPE_QOS_DATA) {
+		__le16 *qos_control;
+
+		memcpy(skb_push(skb, hdrlen - 2), &hdr, hdrlen - 2);
+		qos_control = (__le16*) skb_push(skb, 2);
+		/*
+		 * Maybe we could actually set some fields here, for now just
+		 * initialise to zero to indicate no special operation.
+		 */
+		*qos_control = 0;
+	} else
+		memcpy(skb_push(skb, hdrlen), &hdr, hdrlen);
+
 	nh_pos += hdrlen;
 	h_pos += hdrlen;
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-31 21:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 14:22 [PATCH] mac80211: don't send invalid QoS frames Johannes Berg
2007-08-31  8:43 ` Kalle Valo
2007-08-31 10:12   ` Johannes Berg
2007-08-31 11:25 ` Johannes Berg
2007-08-31 11:37 ` [PATCH v2] " Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.