2010-01-29 23:39:44

by Zhao, Shanyu

[permalink] [raw]
Subject: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

From: Shanyu Zhao <[email protected]>

Need to set bssid to NULL in cfg80211's SIOCIWESSID function, otherwise
after "iwconfig wlanx ap <mac>", the "iwconfig wlanx essid" won't work.

Cc: [email protected]

Signed-off-by: Shanyu Zhao <[email protected]>
---
net/wireless/wext-sme.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index eede356..5a67dd5 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -194,6 +194,7 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev,
wdev->wext.connect.ssid = wdev->wext.ssid;
memcpy(wdev->wext.ssid, ssid, len);
wdev->wext.connect.ssid_len = len;
+ wdev->wext.connect.bssid = NULL;

wdev->wext.connect.crypto.control_port = false;

--
1.6.0.4



2010-01-30 08:37:11

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

On Fri, 2010-01-29 at 15:39 -0800, [email protected] wrote:
> From: Shanyu Zhao <[email protected]>
>
> Need to set bssid to NULL in cfg80211's SIOCIWESSID function, otherwise
> after "iwconfig wlanx ap <mac>", the "iwconfig wlanx essid" won't work.
>
> Cc: [email protected]
>
> Signed-off-by: Shanyu Zhao <[email protected]>
> ---
> net/wireless/wext-sme.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
> index eede356..5a67dd5 100644
> --- a/net/wireless/wext-sme.c
> +++ b/net/wireless/wext-sme.c
> @@ -194,6 +194,7 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev,
> wdev->wext.connect.ssid = wdev->wext.ssid;
> memcpy(wdev->wext.ssid, ssid, len);
> wdev->wext.connect.ssid_len = len;
> + wdev->wext.connect.bssid = NULL;

This is incorrect. If you want to connect to an AP with the SSID "foo"
and the BSSID "00:...:ff" you need to make two calls, e.g.

iwconfig wlan0 essid "foo"
iwconfig wlan0 ap "00:...:ff"

Your patch disables that functionality.

johannes


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

2010-02-01 18:57:16

by Zhao, Shanyu

[permalink] [raw]
Subject: RE: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

DQpBY3R1YWxseSBJIGRvbid0IHRoaW5rIG15IHBhdGNoIGRpc2FibGVzIHRoYXQgZnVuY3Rpb25h
bGl0eS4gSWYgdGhlcmUncmUgbXVsdGlwbGUgQVAgd2l0aCB0aGUgc2FtZSBlc3NpZCAiZm9vIiBh
bmQgb25lIG9mIHRoZW0gaGFzIE1BQyAiMDA6Li4uOmZmIiwgdGhlbjoNCg0KaXdjb25maWcgd2xh
bjAgZXNzaWQgImZvbyINClRoaXMgd2lsbCBtYWtlIHRoZSBzdGF0aW9uIGFzc29jaWF0ZSB3aXRo
IHRoZSBmaXJzdCBBUCB3aXRoIGVzc2lkICJmb28iLg0KDQppd2NvbmZpZyB3bGFuMCBhcCAiMDA6
Li4uOmZmIg0KVGhpcyB3aWxsIGRpc2Fzc29jaWF0ZSBmcm9tIHRoZSBwcmV2aW91cyBBUCwgYW5k
IHRoZW4gYXNzb2NpYXRlIHdpdGggdGhlIGZpcnN0IEFQIHdpdGggTUFDICIwMDouLi46ZmYiLg0K
DQpBbSBJIG1pc3NpbmcgYW55dGhpbmcgaGVyZT8NCg0KVGhhbmtzLA0KU2hhbnl1DQoNCi0tLS0t
T3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBKb2hhbm5lcyBCZXJnIFttYWlsdG86am9oYW5u
ZXNAc2lwc29sdXRpb25zLm5ldF0gDQpTZW50OiBTYXR1cmRheSwgSmFudWFyeSAzMCwgMjAxMCAx
MjozNyBBTQ0KVG86IFpoYW8sIFNoYW55dQ0KQ2M6IGxpbnV4LXdpcmVsZX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gKmRldiwNCj4gIAl3ZGV2LT53ZXh0LmNvbm5l
Y3Quc3NpZCA9IHdkZXYtPndleHQuc3NpZDsNCj4gIAltZW1jcHkod2Rldi0+d2V4dC5zc2lkLCBz
c2lkLCBsZW4pOw0KPiAgCXdkZXYtPndleHQuY29ubmVjdC5zc2lkX2xlbiA9IGxlbjsNCj4gKwl3
ZGV2LT53ZXh0LmNvbm5lY3QuYnNzaWQgPSBOVUxMOw0KDQpUaGlzIGlzIGluY29ycmVjdC4gSWYg
eW91IHdhbnQgdG8gY29ubmVjdCB0byBhbiBBUCB3aXRoIHRoZSBTU0lEICJmb28iDQphbmQgdGhl
IEJTU0lEICIwMDouLi46ZmYiIHlvdSBuZWVkIHRvIG1ha2UgdHdvIGNhbGxzLCBlLmcuDQoNCml3
Y29uZmlnIHdsYW4wIGVzc2lkICJmb28iDQppd2NvbmZpZyB3bGFuMCBhcCAiMDA6Li4uOmZmIg0K
DQpZb3VyIHBhdGNoIGRpc2FibGVzIHRoYXQgZnVuY3Rpb25hbGl0eS4NCg0Kam9oYW5uZXMNCg==

2010-02-01 20:00:39

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

On Mon, Feb 01, 2010 at 08:27:40PM +0100, Johannes Berg wrote:
> On Mon, 2010-02-01 at 10:57 -0800, Zhao, Shanyu wrote:
> > Actually I don't think my patch disables that functionality. If
> > there're multiple AP with the same essid "foo" and one of them has MAC
> > "00:...:ff", then:
> >
> > iwconfig wlan0 essid "foo"
> > This will make the station associate with the first AP with essid
> > "foo".
> >
> > iwconfig wlan0 ap "00:...:ff"
> > This will disassociate from the previous AP, and then associate with
> > the first AP with MAC "00:...:ff".
> >
> > Am I missing anything here?
>
> No, I missed something. The problem will only occur when the SSID is
> hidden as well, because the connect code will not have the SSID and not
> know what to scan for, or which SSID to choose (there are Cisco APs that
> use the same BSSID for multiple hidden SSIDs).

Well, in the confusion I deleted the original post. Could you
(i.e. Shanyu Zhao) resend it to me?

Thanks,

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2010-02-01 19:27:45

by Johannes Berg

[permalink] [raw]
Subject: RE: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

On Mon, 2010-02-01 at 10:57 -0800, Zhao, Shanyu wrote:
> Actually I don't think my patch disables that functionality. If
> there're multiple AP with the same essid "foo" and one of them has MAC
> "00:...:ff", then:
>
> iwconfig wlan0 essid "foo"
> This will make the station associate with the first AP with essid
> "foo".
>
> iwconfig wlan0 ap "00:...:ff"
> This will disassociate from the previous AP, and then associate with
> the first AP with MAC "00:...:ff".
>
> Am I missing anything here?

No, I missed something. The problem will only occur when the SSID is
hidden as well, because the connect code will not have the SSID and not
know what to scan for, or which SSID to choose (there are Cisco APs that
use the same BSSID for multiple hidden SSIDs).

johannes


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

2010-02-01 21:30:35

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

On Mon, Feb 01, 2010 at 10:25:04PM +0100, Johannes Berg wrote:
> On Mon, 2010-02-01 at 14:47 -0500, John W. Linville wrote:
>
> > > > iwconfig wlan0 essid "foo"
> > > > This will make the station associate with the first AP with essid
> > > > "foo".
> > > >
> > > > iwconfig wlan0 ap "00:...:ff"
> > > > This will disassociate from the previous AP, and then associate with
> > > > the first AP with MAC "00:...:ff".
> > > >
> > > > Am I missing anything here?
> > >
> > > No, I missed something. The problem will only occur when the SSID is
> > > hidden as well, because the connect code will not have the SSID and not
> > > know what to scan for, or which SSID to choose (there are Cisco APs that
> > > use the same BSSID for multiple hidden SSIDs).
> >
> > Well, in the confusion I deleted the original post. Could you
> > (i.e. Shanyu Zhao) resend it to me?
>
> Sorry -- I wasn't clear. My mail missed something in describing the
> problem, but that doesn't change the fact that the patch will break it.

OK, thanks for clarifying! :-)

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2010-02-01 21:25:14

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] cfg80211: wext: set bssid to NULL in SIOCIWESSID

On Mon, 2010-02-01 at 14:47 -0500, John W. Linville wrote:

> > > iwconfig wlan0 essid "foo"
> > > This will make the station associate with the first AP with essid
> > > "foo".
> > >
> > > iwconfig wlan0 ap "00:...:ff"
> > > This will disassociate from the previous AP, and then associate with
> > > the first AP with MAC "00:...:ff".
> > >
> > > Am I missing anything here?
> >
> > No, I missed something. The problem will only occur when the SSID is
> > hidden as well, because the connect code will not have the SSID and not
> > know what to scan for, or which SSID to choose (there are Cisco APs that
> > use the same BSSID for multiple hidden SSIDs).
>
> Well, in the confusion I deleted the original post. Could you
> (i.e. Shanyu Zhao) resend it to me?

Sorry -- I wasn't clear. My mail missed something in describing the
problem, but that doesn't change the fact that the patch will break it.

johannes


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