* [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object
@ 2013-10-14 22:38 Antonio Quartulli
2013-10-14 22:38 ` [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join Antonio Quartulli
2013-10-17 14:35 ` [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Johannes Berg
0 siblings, 2 replies; 7+ messages in thread
From: Antonio Quartulli @ 2013-10-14 22:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
From: Antonio Quartulli <antonio@open-mesh.com>
It may be the case that the same IBSS (same bssid and essid)
exists on two different channels (i.e. two IBSSes created
with different but fixed freq) and therefore the latter must
be also used to distinguish them.
Fix wdev->current_bss assignment by passing the channel to
cfg80211_get_bss() on ibss_joined.
This ensures that cfg80211_get_bss() picks up the proper bss
object.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/wireless/ibss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 403fe29..12c878b 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -28,7 +28,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
if (!wdev->ssid_len)
return;
- bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
+ bss = cfg80211_get_bss(wdev->wiphy, wdev->channel, bssid,
wdev->ssid, wdev->ssid_len,
WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
2013-10-14 22:38 [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Antonio Quartulli
@ 2013-10-14 22:38 ` Antonio Quartulli
2013-10-17 14:36 ` Johannes Berg
2013-10-17 14:35 ` [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Johannes Berg
1 sibling, 1 reply; 7+ messages in thread
From: Antonio Quartulli @ 2013-10-14 22:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
From: Antonio Quartulli <antonio@open-mesh.com>
To allow cfg80211 to use the real channel to pick up the
proper (i)bss object, store the used channel in
wdev->channel during ibss_join
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/mac80211/ibss.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index a12afe7..2b5aa4b 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -331,6 +331,12 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
bss = cfg80211_inform_bss_width_frame(local->hw.wiphy, chan,
scan_width, mgmt,
presp->head_len, 0, GFP_KERNEL);
+
+ /* store the channel so that it can be used by cfg80211 to retrieve the
+ * correct bss object
+ */
+ sdata->wdev.channel = chan;
+
cfg80211_put_bss(local->hw.wiphy, bss);
netif_carrier_on(sdata->dev);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object
2013-10-14 22:38 [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Antonio Quartulli
2013-10-14 22:38 ` [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join Antonio Quartulli
@ 2013-10-17 14:35 ` Johannes Berg
1 sibling, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2013-10-17 14:35 UTC (permalink / raw)
To: Antonio Quartulli; +Cc: linux-wireless, Antonio Quartulli
On Tue, 2013-10-15 at 00:38 +0200, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
>
> It may be the case that the same IBSS (same bssid and essid)
> exists on two different channels (i.e. two IBSSes created
> with different but fixed freq) and therefore the latter must
> be also used to distinguish them.
>
> Fix wdev->current_bss assignment by passing the channel to
> cfg80211_get_bss() on ibss_joined.
> This ensures that cfg80211_get_bss() picks up the proper bss
> object.
This makes no sense, wdev->channel should always be NULL (unless the
same wdev was in AP or mesh mode first and that somehow leaked out?)
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
2013-10-14 22:38 ` [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join Antonio Quartulli
@ 2013-10-17 14:36 ` Johannes Berg
2013-10-17 14:48 ` Antonio Quartulli
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2013-10-17 14:36 UTC (permalink / raw)
To: Antonio Quartulli; +Cc: linux-wireless, Antonio Quartulli
On Tue, 2013-10-15 at 00:38 +0200, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
>
> To allow cfg80211 to use the real channel to pick up the
> proper (i)bss object, store the used channel in
> wdev->channel during ibss_join
WTF? No, mac80211 can't just randomly modify cfg80211-owned data.
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
2013-10-17 14:36 ` Johannes Berg
@ 2013-10-17 14:48 ` Antonio Quartulli
2013-10-17 14:51 ` Johannes Berg
0 siblings, 1 reply; 7+ messages in thread
From: Antonio Quartulli @ 2013-10-17 14:48 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
On Thu, Oct 17, 2013 at 04:36:28PM +0200, Johannes Berg wrote:
> On Tue, 2013-10-15 at 00:38 +0200, Antonio Quartulli wrote:
> > From: Antonio Quartulli <antonio@open-mesh.com>
> >
> > To allow cfg80211 to use the real channel to pick up the
> > proper (i)bss object, store the used channel in
> > wdev->channel during ibss_join
>
> WTF? No, mac80211 can't just randomly modify cfg80211-owned data.
Mh, ok. :)
What about setting wdev->channel in __cfg80211_join_ibss() right after having
set wdev->ssid ?
This way we leave mac80211 out and we totally handle this thing in cfg80211
only.
(I think with this change patch 1/2 makes more sense?)
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
2013-10-17 14:48 ` Antonio Quartulli
@ 2013-10-17 14:51 ` Johannes Berg
2013-10-17 14:57 ` Antonio Quartulli
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2013-10-17 14:51 UTC (permalink / raw)
To: Antonio Quartulli; +Cc: linux-wireless, Antonio Quartulli
On Thu, 2013-10-17 at 16:48 +0200, Antonio Quartulli wrote:
> On Thu, Oct 17, 2013 at 04:36:28PM +0200, Johannes Berg wrote:
> > On Tue, 2013-10-15 at 00:38 +0200, Antonio Quartulli wrote:
> > > From: Antonio Quartulli <antonio@open-mesh.com>
> > >
> > > To allow cfg80211 to use the real channel to pick up the
> > > proper (i)bss object, store the used channel in
> > > wdev->channel during ibss_join
> >
> > WTF? No, mac80211 can't just randomly modify cfg80211-owned data.
>
> Mh, ok. :)
>
> What about setting wdev->channel in __cfg80211_join_ibss() right after having
> set wdev->ssid ?
> This way we leave mac80211 out and we totally handle this thing in cfg80211
> only.
Locking might be problematic though. I also don't know where else the
channel might be used?
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
2013-10-17 14:51 ` Johannes Berg
@ 2013-10-17 14:57 ` Antonio Quartulli
0 siblings, 0 replies; 7+ messages in thread
From: Antonio Quartulli @ 2013-10-17 14:57 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
[-- Attachment #1: Type: text/plain, Size: 982 bytes --]
On Thu, Oct 17, 2013 at 04:51:28PM +0200, Johannes Berg wrote:
> On Thu, 2013-10-17 at 16:48 +0200, Antonio Quartulli wrote:
> > On Thu, Oct 17, 2013 at 04:36:28PM +0200, Johannes Berg wrote:
> > > On Tue, 2013-10-15 at 00:38 +0200, Antonio Quartulli wrote:
> > > > From: Antonio Quartulli <antonio@open-mesh.com>
> > > >
> > > > To allow cfg80211 to use the real channel to pick up the
> > > > proper (i)bss object, store the used channel in
> > > > wdev->channel during ibss_join
> > >
> > > WTF? No, mac80211 can't just randomly modify cfg80211-owned data.
> >
> > Mh, ok. :)
> >
> > What about setting wdev->channel in __cfg80211_join_ibss() right after having
> > set wdev->ssid ?
> > This way we leave mac80211 out and we totally handle this thing in cfg80211
> > only.
>
> Locking might be problematic though. I also don't know where else the
> channel might be used?
I don't think it is used elsewhere in IBSS mode
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-10-17 14:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-14 22:38 [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Antonio Quartulli
2013-10-14 22:38 ` [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join Antonio Quartulli
2013-10-17 14:36 ` Johannes Berg
2013-10-17 14:48 ` Antonio Quartulli
2013-10-17 14:51 ` Johannes Berg
2013-10-17 14:57 ` Antonio Quartulli
2013-10-17 14:35 ` [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox