linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan
@ 2007-08-07 20:33 John W. Linville
  2007-08-08  7:56 ` Michael Wu
  0 siblings, 1 reply; 5+ messages in thread
From: John W. Linville @ 2007-08-07 20:33 UTC (permalink / raw)
  To: linux-wireless

From: John W. Linville <linville@tuxdriver.com>

Probe for hidden SSIDs if initiating pre-authentication scan and SSID
is set for STA interface.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
The ternary conditionals are a bit ugly.  I guess I could recode it
with temp vars initialized before calling ieee80211_sta_start_scan.

Any other complaints?

 net/mac80211/ieee80211_sta.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 007dd08..9f467cc 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -3217,7 +3217,10 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
 		return 0;
 	} else {
 		if (ifsta->state != IEEE80211_AUTHENTICATE) {
-			ieee80211_sta_start_scan(dev, NULL, 0);
+			ieee80211_sta_start_scan(dev, ifsta->auto_ssid_sel ?
+							NULL : ifsta->ssid,
+						 ifsta->auto_ssid_sel ?
+							0 : ifsta->ssid_len);
 			ifsta->state = IEEE80211_AUTHENTICATE;
 			set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request);
 		} else
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan
  2007-08-07 20:33 [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan John W. Linville
@ 2007-08-08  7:56 ` Michael Wu
  2007-08-08  9:34   ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Wu @ 2007-08-08  7:56 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Tuesday 07 August 2007 13:33, John W. Linville wrote:
> The ternary conditionals are a bit ugly.  I guess I could recode it
> with temp vars initialized before calling ieee80211_sta_start_scan.
>
Something more like:

if (ifsta->auto_ssid_sel && ifsta->ssid_len)
  ieee80211_sta_start_scan(dev, NULL, 0);
else
  ieee80211_sta_start_scan(dev, ifsta->ssid, ifsta->ssid_len);

would be better.

-Michael Wu

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan
  2007-08-08  7:56 ` Michael Wu
@ 2007-08-08  9:34   ` Johannes Berg
  2007-08-08  9:41     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2007-08-08  9:34 UTC (permalink / raw)
  To: Michael Wu; +Cc: John W. Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

On Wed, 2007-08-08 at 00:56 -0700, Michael Wu wrote:
> On Tuesday 07 August 2007 13:33, John W. Linville wrote:
> > The ternary conditionals are a bit ugly.  I guess I could recode it
> > with temp vars initialized before calling ieee80211_sta_start_scan.
> >
> Something more like:
> 
> if (ifsta->auto_ssid_sel && ifsta->ssid_len)
>   ieee80211_sta_start_scan(dev, NULL, 0);
> else
>   ieee80211_sta_start_scan(dev, ifsta->ssid, ifsta->ssid_len);

Except you got the condition inverted.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan
  2007-08-08  9:34   ` Johannes Berg
@ 2007-08-08  9:41     ` Johannes Berg
  2007-08-09  4:16       ` Michael Wu
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2007-08-08  9:41 UTC (permalink / raw)
  To: Michael Wu; +Cc: John W. Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

On Wed, 2007-08-08 at 11:34 +0200, Johannes Berg wrote:
> On Wed, 2007-08-08 at 00:56 -0700, Michael Wu wrote:
> > On Tuesday 07 August 2007 13:33, John W. Linville wrote:
> > > The ternary conditionals are a bit ugly.  I guess I could recode it
> > > with temp vars initialized before calling ieee80211_sta_start_scan.
> > >
> > Something more like:
> > 
> > if (ifsta->auto_ssid_sel && ifsta->ssid_len)
> >   ieee80211_sta_start_scan(dev, NULL, 0);
> > else
> >   ieee80211_sta_start_scan(dev, ifsta->ssid, ifsta->ssid_len);
> 
> Except you got the condition inverted.

Well, not fully inverted. Shouldn't it be

if (!ifsta->auto_ssid_sel && ifsta->ssid_len)
	...(dev, ifsta->ssid, ifsta->ssid_len)
else
	...(dev, NULL, 0)

On the other hand, calling with a "anything, 0" probably has the same
effect as calling with "NULL, 0" so the "ifsta->ssid_len" condition can
go away just as linville had it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan
  2007-08-08  9:41     ` Johannes Berg
@ 2007-08-09  4:16       ` Michael Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Wu @ 2007-08-09  4:16 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John W. Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

On Wednesday 08 August 2007 02:41, Johannes Berg wrote:
> On the other hand, calling with a "anything, 0" probably has the same
> effect as calling with "NULL, 0" so the "ifsta->ssid_len" condition can
> go away just as linville had it.
>
Yep.

-Michael Wu

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-09  4:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07 20:33 [PATCH] mac80211: probe for hidden SSIDs in pre-auth scan John W. Linville
2007-08-08  7:56 ` Michael Wu
2007-08-08  9:34   ` Johannes Berg
2007-08-08  9:41     ` Johannes Berg
2007-08-09  4:16       ` Michael Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).