2009-02-09 20:01:04

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211: reject extra IEs for probe resp when hw_scan

We cannot currently hand off extra IEs to hw_scan, so reject
configuring extra IEs for probe response frames when hw_scan
is set.

Signed-off-by: Johannes Berg <[email protected]>
Cc: Jouni Malinen <[email protected]>
---
net/mac80211/cfg.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

--- wireless-testing.orig/net/mac80211/cfg.c 2009-02-09 20:56:40.000000000 +0100
+++ wireless-testing/net/mac80211/cfg.c 2009-02-09 20:58:46.000000000 +0100
@@ -1176,9 +1176,12 @@ static int ieee80211_set_channel(struct
return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
}

-static int set_mgmt_extra_ie_sta(struct ieee80211_if_sta *ifsta, u8 subtype,
- u8 *ies, size_t ies_len)
+static int set_mgmt_extra_ie_sta(struct ieee80211_sub_if_data *sdata,
+ u8 subtype, u8 *ies, size_t ies_len)
{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_if_sta *ifsta = &sdata->u.sta;
+
switch (subtype) {
case IEEE80211_STYPE_PROBE_REQ >> 4:
kfree(ifsta->ie_probereq);
@@ -1186,6 +1189,8 @@ static int set_mgmt_extra_ie_sta(struct
ifsta->ie_probereq_len = ies_len;
return 0;
case IEEE80211_STYPE_PROBE_RESP >> 4:
+ if (local->ops->hw_scan)
+ break;
kfree(ifsta->ie_proberesp);
ifsta->ie_proberesp = ies;
ifsta->ie_proberesp_len = ies_len;
@@ -1244,7 +1249,7 @@ static int ieee80211_set_mgmt_extra_ie(s
switch (sdata->vif.type) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_ADHOC:
- ret = set_mgmt_extra_ie_sta(&sdata->u.sta, params->subtype,
+ ret = set_mgmt_extra_ie_sta(sdata, params->subtype,
ies, ies_len);
break;
default:




2009-02-09 20:03:06

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: reject extra IEs for probe resp when hw_scan

On Mon, 2009-02-09 at 21:00 +0100, Johannes Berg wrote:
> We cannot currently hand off extra IEs to hw_scan, so reject
> configuring extra IEs for probe response frames when hw_scan
> is set.

Umm, that was screwed up, should be in probe request! Ignore this patch.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2009-02-09 20:06:39

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] mac80211: reject extra IEs for probe resp when hw_scan

On Mon, Feb 09, 2009 at 09:00:31PM +0100, Johannes Berg wrote:
> We cannot currently hand off extra IEs to hw_scan, so reject
> configuring extra IEs for probe response frames when hw_scan
> is set.

Assuming this was for probe request.. I'm actually planning on adding
support to pass the extra IEs into hw_scan handler, so that would need
to revert this type of patch for probe req should one make in. Anyway,
that will also make it more difficult to figure out whether the IEs can
actually be added since the driver would need to somehow indicate
whether it supports this or not.

--
Jouni Malinen PGP id EFC895FA

2009-02-09 20:10:26

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: reject extra IEs for probe resp when hw_scan

On Mon, 2009-02-09 at 22:06 +0200, Jouni Malinen wrote:
> On Mon, Feb 09, 2009 at 09:00:31PM +0100, Johannes Berg wrote:
> > We cannot currently hand off extra IEs to hw_scan, so reject
> > configuring extra IEs for probe response frames when hw_scan
> > is set.
>
> Assuming this was for probe request..

Yeah, it was meant to, but I screwed up.

> I'm actually planning on adding
> support to pass the extra IEs into hw_scan handler, so that would need
> to revert this type of patch for probe req should one make in. Anyway,
> that will also make it more difficult to figure out whether the IEs can
> actually be added since the driver would need to somehow indicate
> whether it supports this or not.

Since I've posted my cfg80211 scan work, and I guess it'll go in, how
about instead extending that to pass in IEs? The scan request struct is
already passed down from cfg80211 through mac80211 to drivers, so
anything in there would be available to drivers too.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part