linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Restore rx.fc before every invocation of ieee80211_invoke_rx_handlers
@ 2007-12-21 14:16 Helmut Schaa
  2007-12-23  9:24 ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Helmut Schaa @ 2007-12-21 14:16 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless

This patch fixes a problem with rx handling on multiple interfaces. Especially 
when using hardware-scanning and a wireless driver (i.e. iwlwifi) which is 
able to receive data while scanning.

The rx handlers can modify the skb and the frame control field (see 
ieee80211_rx_h_remove_qos_control) but since every interface gets its own 
copy of the skb each should get its own copy of rx.fc too.

In my case the wlan0-interface did not remove the qos-control from the frame 
because the corresponding flag in rx.fc was already removed while processing 
the frame on the master interface. Therefore somehow corrupted frames were 
passed to the userspace.

Signed-off-by: Helmut Schaa <hschaa@suse.de>
---
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 362e8e5..08a6905 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1723,6 +1723,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct 
sk_buff *skb,
 				       prev->dev->name);
 			continue;
 		}
+		rx.fc = le16_to_cpu(hdr->frame_control);
 		rx.skb = skb_new;
 		rx.dev = prev->dev;
 		rx.sdata = prev;
@@ -1731,6 +1732,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct 
sk_buff *skb,
 		prev = sdata;
 	}
 	if (prev) {
+		rx.fc = le16_to_cpu(hdr->frame_control);
 		rx.skb = skb;
 		rx.dev = prev->dev;
 		rx.sdata = prev;

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

end of thread, other threads:[~2007-12-25 10:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 14:16 [PATCH] mac80211: Restore rx.fc before every invocation of ieee80211_invoke_rx_handlers Helmut Schaa
2007-12-23  9:24 ` Johannes Berg
2007-12-23 11:35   ` Helmut Schaa
2007-12-23 13:48     ` Johannes Berg
2007-12-23 15:52       ` Helmut Schaa
2007-12-24  3:34       ` Zhu Yi
2007-12-24 10:23         ` Johannes Berg
2007-12-24 11:49           ` Helmut Schaa
2007-12-25  3:31           ` Zhu Yi
2007-12-25 10:40             ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).