Thread (19 messages) 19 messages, 1 author, 2006-10-18
STALE7197d
Revisions (5)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 current
  4. v1 [diff vs current]
  5. v1 [diff vs current]

[PATCH 1/18] d80211: fix is_ieee80211_device

From: Jiri Benc <hidden>
Date: 2006-10-18 15:48:56
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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(-)

54bac502265add95b8ca098ccf62c1d506daeb86
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 1ef2707..3efba6a 100644
--- a/net/d80211/ieee80211.c
+++ b/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;
 	}
-- 
1.3.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help