Skip to contentSkip to conversation

d80211: Fix ieee80211_ptr check

PATCH In review Michael Wu 3 participants 3 messages Feb 20, 2007 – Feb 22, 2007 Networking

lore
Share & tools
lore

Michael Wu

author
#0 lore raw

PATCH 1/1 d80211: Fix ieee80211_ptr check

d80211: Fix ieee80211_ptr check

dev->ieee80211_ptr can no longer be directly compared to check if a virtual interface belongs to a master device.

---

 net/d80211/ieee80211.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/d80211/ieee80211.c +2 -1
index adce657..70eb9be 100644
@@ -1093,7 +1093,8 @@ __ieee80211_tx_prepare(struct ieee80211_
 static int inline is_ieee80211_device(struct net_device *dev,
 				      struct net_device *master)
 {
-	return (dev->ieee80211_ptr == master->ieee80211_ptr);
+	return (wdev_priv(dev->ieee80211_ptr) ==
+		wdev_priv(master->ieee80211_ptr));
 }
 
 /* Device in tx->dev has a reference added; use dev_put(tx->dev) when
#1 lore raw
Quoted 2 lines · Michael Wu

dev->ieee80211_ptr can no longer be directly compared to check if a virtual interface belongs to a master device.

Hm, apparently the regexp I tried when resolving conflicts with John's tree wasn't good enough to catch this :-(

Let's hope there are no more such things left.

Thanks for finding this,

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#2 lore raw
Quoted 6 lines · Jiri Benc
Quoted 2 lines · Michael Wu

dev->ieee80211_ptr can no longer be directly compared to check if a virtual interface belongs to a master device.

Hm, apparently the regexp I tried when resolving conflicts with John's tree wasn't good enough to catch this :-(

No, that's an error I made.

Quoted 1 line

Let's hope there are no more such things left.

I doubt it. I should have remembered this special case but forgot about it. The thing is that in earlier wiphy versions I had ieee80211_ptr point to the wiphy directly so I *intentionally* kept the comparison like that when reviewing all uses of ieee80211_ptr. When I realised that we need per-netdev wireless state I put that behind ieee80211_ptr and then forgot to update this spot.

johannes