DORMANTno replies

[PATCH] d80211: fix is_ieee80211_device

From: Jiri Benc <hidden>
Date: 2006-09-27 15:57:22

The is_ieee80211_device function must ensure that the passed net_device
belongs to the hardware device we are working with.

Signed-off-by: Jiri Benc <redacted>

---
 net/d80211/ieee80211.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
--- dscape.orig/net/d80211/ieee80211.c
+++ dscape/net/d80211/ieee80211.c
@@ -1123,9 +1123,10 @@ __ieee80211_tx_prepare(struct ieee80211_
 
 }
 
-static int inline is_ieee80211_device(struct net_device *dev)
+static int inline is_ieee80211_device(struct net_device *dev,
+				      struct net_device *master)
 {
-	return (dev->ieee80211_ptr != NULL);
+	return (dev->ieee80211_ptr == master->ieee80211_ptr);
 }
 
 /* Device in tx->dev has a reference added; use dev_put(tx->dev) when
@@ -1140,7 +1141,7 @@ static void inline ieee80211_tx_prepare(
 
 	pkt_data = (struct ieee80211_tx_packet_data *)skb->cb;
 	dev = dev_get_by_index(pkt_data->ifindex);
-	if (unlikely(dev && !is_ieee80211_device(dev))) {
+	if (unlikely(dev && !is_ieee80211_device(dev, mdev))) {
 		dev_put(dev);
 		dev = NULL;
 	}
@@ -1395,7 +1396,7 @@ static int ieee80211_master_start_xmit(s
 
 	if (pkt_data->ifindex)
 		odev = dev_get_by_index(pkt_data->ifindex);
-	if (unlikely(odev && !is_ieee80211_device(odev))) {
+	if (unlikely(odev && !is_ieee80211_device(odev, dev))) {
 		dev_put(odev);
 		odev = NULL;
 	}

-- 
Jiri Benc
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help